Created
February 3, 2017 08:46
-
-
Save Jikizuari/d06efe91618e7c4298b125455fc3d3c7 to your computer and use it in GitHub Desktop.
Prevent Superfish from hovering on tablet portrait and lower
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var menu = function () { | |
var window_width = $(document).width(), | |
menu_element = $('#main-menu ul.menu'); | |
menu_element.superfish(); | |
if (window_width < 1024) { | |
menu_element.off('mouseenter mouseleave'); | |
} | |
window.addEventListener("orientationchange", function () { | |
menu(); | |
}, false); | |
window.addEventListener("resize", function () { | |
menu(); | |
}, false); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment