twitter bootstrap - if statement combined with jQuery .hover -
i working bootstrap , make drop down menu fade in when in full screen, when window size smaller dose not want turn off , rely on basic bootstrap. here code. cant seem if statement work.
if ($(window).width() > 766){ $('.navbar .dropdown').hover(function() { $(this).find('.dropdown-menu').first().stop(true, true).fadein(500)}, function() { $(this).find('.dropdown-menu').first().stop(true, true).fadeout(500) }); };
keep in mind jquery's find()
select descendants of .dropdown
elements you're searching
also, way jquery selector hover
written (with spaces) cause binding apply .dropdown
children of .navbar
, relationship must this:
<div class="navbar"> <div class="dropdown"> hovering here shows menu <div class="dropdown-menu"> menu fades </div> </div> </div>
Comments
Post a Comment