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

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -