jquery - Hover over opaque menu [UPDATED] -


here fancy menu..

 <script type="text/javascript"> $('#brand_logo').bind('inview', function(event, visible) { if (visible == true) { // console.log("visible"); $("#topnav").animate({ opacity: 1.0 }); // $(".head-wrap-left").hide(); } else { // console.log("invisible"); $("#topnav").animate({ opacity: 0.6 }); // $(".head-wrap-left").show(); } }); </script>รข€‹ 

there 1 problem.. if user reloads page , element not in viewport, defaults 1.0 opacity. how can fix this?

have tried bind inview , mouseenter? this:

 $('#brand_logo').bind('inview mouseenter', function(event, visible) {..} 

you don't need use .find inview event should triggered if in viewport on refresh or load.


Comments

Popular posts from this blog

javascript - backbone.js Collection.add() doesn't `construct` (`initialize`) an object -

php - Get uncommon values from two or more arrays -

Adding duplicate array rows in Php -