Skip to content

Instantly share code, notes, and snippets.

@theStreets93
Created June 10, 2016 12:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save theStreets93/063ab7a0868bb58cc55d5d6e667643f0 to your computer and use it in GitHub Desktop.
Save theStreets93/063ab7a0868bb58cc55d5d6e667643f0 to your computer and use it in GitHub Desktop.
Magento RWD Theme - Delay on Top Navigation
mouseEnterAction: function(event, target) {
if(this.useSmallScreenBehavior()) {
return; // don't do mouse enter functionality on smaller screens
}
window.mytimeout = setTimeout(function(){
$j(target).addClass('menu-active'); //show current menu
}, 300);
},
mouseLeaveAction: function(event, target) {
if(this.useSmallScreenBehavior()) {
return; // don't do mouse leave functionality on smaller screens
}
clearTimeout(window.mytimeout);
$j(target).removeClass('menu-active'); //hide all menus
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment