mouseover - Hoverstate on parent jQuery script works only one way -
mouseover - Hoverstate on parent jQuery script works only one way -
i want parent items in navigation have hover or active state when hover on kid items.
so looked around , found out can utilize jquery accomplish this. made script:
<script> jquery(document).ready(function($) { var $nav = $('#productnav ul.sub-menu li'); $nav.mouseover(function() { $("#productnav ul.sf-menu li.deeper").addclass(' overstate ') } ); $nav.mouseleave(function() { $("#productnav ul .sf-menu li.deeper").removeclass(' overstate ') } ); }); </script>
after few hours (and reading lot), got work. partially.
the class added parent, works fine. not removed. tried create hover method jquery same result.
anybody know what's wrong in script?
regards, hans
check this:
$("#productnav ul.sf-menu li.deeper") $("#productnav ul .sf-menu li.deeper")
try remove blank space between "ul" , ".sf" of sec selector.
the rest of code looks fine , should work.
jquery mouseover addclass removeclass mouseout
Comments
Post a Comment