Hello all,
I am having a small problem. I have a nevigation build which opens when mouse is over, but also listens to keypress, than firing same animation as if mouse is over, just additionally opens the submenu. Now, when keypress is active and I am going with the mouse over that navigation, it fires the closing action before I can click a link. How can I prevent that closing action?
$(function () {
// keypress
$('html').live('keydown', function (e) {
if ( e.keyCode == 67 ){
$("#control").animate({width: '+=105', duration:400},
function(){
/*callback*/
$("#control").css({overflow:'visible'});
$("#control-menu li a").fadeTo('fast', 1);
$("#categories ul").css({marginLeft: '140px', display: 'block'}).fadeIn('slow');
$('#control').mouseenter(function() { $(this).stop(); });
}
)
}
});
// set easing method
jQuery.easing.def = 'easeInOutExpo';
// make menu work
$("#control-menu li a").css({opacity:'0.1'});
$("#control").hoverIntent(
function(){
$(this).stop().animate(
{width: '+=105',
duration:400}, function(){
/*callback*/
$("#control").css({overflow:'visible'});
$("#control-menu li a").fadeTo('fast', 1);
})
},
function(){
$("#control-menu li a").fadeTo('fast', 0.1);
$(this).stop().animate(
{width: '-=105',
duration:800}, function(){
/*callback*/
$("#control").css({overflow:'hidden'});
})
});
// END
});
Thanks in advance for the help!!!!
Kindly regards, Daniel