$(function() {window.setInterval("$('.myImage').toggle();",2000);});
Run Code Online (Sandbox Code Playgroud)
像这样的东西:
function blink(time, interval){
var timer = window.setInterval(function(){
$("img").css("opacity", "0.1");
window.setTimeout(function(){
$("img").css("opacity", "1");
}, 100);
}, interval);
window.setTimeout(function(){clearInterval(timer);}, time);
}
Run Code Online (Sandbox Code Playgroud)
并启动功能 blink(900000, 1000);