jquery - Alternative color class after first elements -
I have to add a class that will list the style list differently because I have more than one list on one page And I need to restart the style for each list, but I have decided to look at each list. $ ('ul.myList'). Each (function) {$ ('Li: visible: even: no (.red, .green)'). AddClass ('newStyle');}); Some items are hidden and need to drop the top two items in each list. & lt; Ul & gt; & Lt; Li class = "red" & gt; ... & lt; / li & gt; & Lt; Li class = "blue" & gt; ... & lt; / li & gt; & Lt; Li & gt; ... & lt; / li & gt; & Lt; Li & gt; ... & lt; / li & gt; & Lt; li class = "hidden" & gt; ... & lt; / li & gt; & Lt; Li & gt; ... & lt; / li & gt; & Lt; / Ul & gt; & Lt; Ul & gt; & Lt; Li class = "red" & gt; ... & lt; / li & gt; & Lt; Li class = "blue" & gt; ... ...