setTimeout mouseenter/mouseleave
I'm trying to set a timeout on a sub-menu with mouseenter/mouseleave
function but it doesn't work with my current code. If already searched
across stack overflow but it hasn't solved my problem yet, so hopefully
someone has the right solution for me.
jQuery('.vertical-menu .sub-menu').hide();
jQuery('.vertical-menu ul li').mouseenter(
function(){
setTimeout(function(){
jQuery('.vertical-menu ul li').not(jQuery('ul', this)).stop();
jQuery('ul', this).stop(true,true)
.css({ 'opacity': '0' })
.animate({ width: 'toggle', 'opacity':'1' },{ queue: false,
duration: 350 });
}, 2000);
})
.mouseleave(
function(){
jQuery('ul', this).animate({ width: 'toggle', 'opacity':'0' },{
queue: false, duration: 350 });
});
});
No comments:
Post a Comment