jquery - Change CSS Class of All previous <li> when i hover some other item -


What I need, with jQuery, can be a lot easier, I just suck it: /

< P> I have a list of the list of this nominated list, what do I do, I change to replace all the CSS classes of the previous list items, when I take any other item.

For example, below this picture, if I want to change the CSS class of 1904, 1902 and 1903. "Text">

You can use to get to all the previous brothers and then use it to add / remove a square:

  $ ("li "). Hover (function) {$ (this) .prevAll ("li") ToggleClass ("myClass");});  

Note that this does not style element, only the previous ones, if you want the hovered style ; Li & gt; Also as :

  $ ("li"). Hover (function {$ (this) .prevAll ("li") and auto (). Toggleclass ("myClass");});  

In this case, we can set & lt; Li & gt; to include.


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -