<div>
<li class="img">1</li>
<li class="img">2</li>
<li class="img hover">3</li>
<li class="img">4</li>
<li class="img">5</li>
</div>
<span>3</span>
above your code hover will be automatically changed in 5 li. How can you rely on js to know which li is currently being hover without refreshing the page?
I thought of an idea, but I haven"t run it yet. In the test, I.
first get how many li, there are. Then if the value of hover, in IndexOf.li is greater than 1, find out the subscript of li greater than 1