olivier
olivier

Reputation: 2645

Dropit dropdown doesn't hide at mouseleave

I have a dropdown and i've set mouseenter as option. So the menu should close if the mouse is outside the trigger. I'm using jQuery 1.8.0. Could this be a CSS problem?

This is my code to init the plugin.

    <script>
        $(document).ready(function() {
            $('.dropit-trigger').dropit({
              action: 'mouseenter'
             });
        });
        </script>

And this is the code for this option in the plugin. What's wrong?

if(settings.action == 'mouseenter'){
  $el.on('mouseleave', '.dropit-open', function(){
    settings.beforeHide.call(this);
    $(this).removeClass('dropit-open').find(settings.submenuEl).hide();
    settings.afterHide.call(this);
  });
} 

Upvotes: 0

Views: 65

Answers (2)

Iqbal Pasha
Iqbal Pasha

Reputation: 1316

instead of using jquery you can use this below css to show/hide dropdown menu.

.dropit-trigger:hover .dropit-submenu-right {
  display : block !important;
}

Upvotes: 1

coffeduong
coffeduong

Reputation: 1463

Change your jquery to

<script>
    $(document).ready(function () {
        $('.navi').dropit({
            action: 'mouseenter'
        });
    });
</script>

Upvotes: 0

Related Questions