Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何每 5 秒切换 1 秒的课程?
这是我想要的动作,只需要让它发生 1 秒,每 5 秒..
$('#donate').toggleClass('wiggle');
使用以下
setInterval(function(){ // toggle the class every five second $('#donate').toggleClass('wiggle'); setTimeout(function(){ // toggle back after 1 second $('#donate').toggleClass('wiggle'); },1000); },5000);
演示 http://jsfiddle.net/joycse06/vqRqf/