When the element level of the same name can not be quickly selected elements is more complex with parent and siblings can use not (this) method is exclusive to switch
cases: Collapse .menuItem-type .sidebar
IF ($ (the this) .pathname == CurrentID) {
$ ( 'sidebar-collapse .menuItem. ') not (this) .removeClass ( "thirdActive");. // let other more complex levels of the same type style elements removed
$ (this) .addClass ( "thirdActive ") / / style to add yourself
}
jquery select other elements in addition to their similar names
Guess you like
Origin blog.csdn.net/qq_43121828/article/details/90403109
Recommended
Ranking