Reputation: 875
I have created a nav with jquery hover effects.
The nav works, the only problem is when you make the screen 800px wide or less and press the red box to display the toggle nav. The hover menu is picking up the jquery from the full width menu.
How can I stop the jquery hover menu from not picking up the hover state of the main menu.
/* MAIN MENU DROPDOWN
===================================*/
$("#toggle-nav").click(function () {
$("#nav").slideToggle('slow');
});
/* MAIN SETTINGS SHOW AND HIDE
===================================*/
$("#user-profile").hover(function(){
$('.tabs').fadeToggle();
});
Upvotes: 1
Views: 797
Reputation: 825
Just check the width of the browser in your hover handler:
$("#user-profile").hover(function(){
if ( $(window).width() > 800 ) $('.tabs').fadeToggle();
});
Upvotes: 3