mercredi 20 juillet 2016

how to activate current navigation link with jQuery

my Fiddle : https://jsfiddle.net/atg5m6ym/6471/

i was trying to create a navigation bar with the active border below each navigation link, when the user hovers on it. but i want that border on the current item that was hovered. i want to remove that border from that other links. i was trying the code, but it seems my logic is not working.

my javascript

 $('ul > li > a').mouseenter(function(){
  $(this).find('div').addClass('activeItemNav').siblings('div').removeClass('activeItemNav');
 });

Aucun commentaire:

Enregistrer un commentaire