小编use*_*762的帖子

JS删除并添加类计时功能

下面是一些我不知道如何修改以做我想要的js.而不是onclick我需要在延迟40秒后激活js.

// retrieve the element
element = document.getElementById("ani");

// reset the transition by...
element.addEventListener("click", function(e){
e.preventDefault;

// -> removing the class
element.classList.remove("delay-1");

// -> triggering reflow /* The actual magic */
// without this it wouldn't work. Try uncommenting the line and the transition won't be         retriggered.
element.offsetWidth = element.offsetWidth;

// -> and re-adding the class
element.classList.add("delay-1");
}, false);
Run Code Online (Sandbox Code Playgroud)

html javascript css jquery

3
推荐指数
1
解决办法
1699
查看次数

标签 统计

css ×1

html ×1

javascript ×1

jquery ×1