|
|
Posted on 12/17/2018 2:12:39 PM
|
|
|
|

The original effect, if you choose between li nodes, you can ensure that the selected nodes can have an activated and selected state, but once you leave the entire ul list, all the selected activation states will disappear, which is not the effect I want, as shown in the figure below:
The code is as follows:
The above effect is not what I want, all I want is to move the mouse up,When the mouse is removed, there must always be a node activated and selected。
The correct code is as follows:
As shown in the picture above, after I move the mouse, there is always a li node that is activated and selected.
When moving to the li node, first find the li sibling label and remove the class style. Next, use the end() method to end the reference to the li tag, which returns the current li node (jQuery object), and then add the style to the addClass() method later. In this way, I believe you have understood the end() method in jQuery.
|
Previous:SqlServer--delete, truncate, and Drop delete tablesNext:When the mouse moves to another layer inside the div, it triggers mouseout
|