Answer the question
In order to leave comments, you need to log in
How, when hovering over li, the current li and all li that come before it, add the active class?
Hello.
Here's an example
How can I add the active class to the current li and all li that come before it when hovering over li?
Answer the question
In order to leave comments, you need to log in
As an additional option:
number the list, for example through data-num="1", cling to the hover event, get the number $(this).data('num'), run a for loop, add classes addClass('active')
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question