[英]Adding two different classes to one function at a different time javascript
I have a JavaScript code and there is one function that I want to add two class to it, but if I add them in the same function line the other class don't work, and when I write each one in the same function but different將第二個 class 排成一行,我想要的只是添加第一個 class 並在 5 秒后添加第二個 class? 我不知道是否有任何方法可以使它工作,但我希望有。
這是第一個 class 僅適用的時間:
function open() {
en.addClass('op').addClass('bo-ac')
.removeClass('cl');
}
這是第二個 class 僅起作用的時候:
function open() {
en.addClass('op')
.removeClass('cl');
}
function open() {
$('.bo').addClass('bo-ac')
}
@不在這里。 我不確定,但這是你要找的東西嗎?
function open() {
en.addClass('op').removeClass('cl');
setTimeout(function() {
en.addClass('bo-ac')
}, 0)
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.