Reputation: 2645
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
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
Reputation: 1463
Change your jquery to
<script>
$(document).ready(function () {
$('.navi').dropit({
action: 'mouseenter'
});
});
</script>
Upvotes: 0