jquery - dropdown menu with same classes -
i have created simple dropdown menu shows ul when the tags hovered on. ebook titles return 2 listings proving pain both of them hover state when 1 being hovered on. hear using "this" select 1 hovering on can't quite right. have far works nicely when there 1 ebook title available.
<a class="button ebook-button" style="width: 150px;">get e-book ...</a> <ul class='ebookrollover'> <li><a href='1'>1</a></li> <li><a href='2'>2</a></li> <li><a href='3'>3</a></li> <li><a href='4'>4</a></li> <li><a href='5'>5</a></li> <li><a href='6'>6</a></li> </ul> <a class="button ebook-button" style="width: 150px;">get e-book ...</a> <ul class='ebookrollover'> <li><a href='1'>1</a></li> <li><a href='2'>2</a></li> <li><a href='3'>3</a></li> <li><a href='4'>4</a></li> <li><a href='5'>5</a></li> <li><a href='6'>6</a></li> </ul> <script type="text/javascript"> $('.ebook-button').parent().css('padding-bottom', '0'); $('.ebookrollover').hide() $('.ebook-button, .ebookrollover').mouseenter(function(){ $('.ebookrollover').show() $('.ebook-button').addclass('active'); }); $('.ebook-button, .ebookrollover').mouseleave(function(){ $('.ebookrollover').hide(); $('.ebook-button').removeclass('active'); }); </script>
Comments
Post a Comment