简体   繁体   中英

never remove active class in jquery

i added a class on my specific button,the button is on the slider,when i clicking the arrow of slider,the slider automaticly adding active class to antoher button, i want to write some method wich will never remove a class of my specific button how can i do it?

this is the code wich adding active class

($(item).parent('.owl-stage').parent('.owl-stage-outer').parent('.img-block').children('.owl-dots').children('button').not('.displayed-slider-btn')[2]).addClass('active');

Just use another class. Class "active" is used by Owl plugin, you can not disable it without crashing the source code. For ex. add specific class "enabled" and copy for it all css style from class "active"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM