图片一出来,过5秒钟,开始闪动,然后停止。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
var inter={};
var i=0;
$(document).ready( function (){
$( "a" ).each( function (index,item){
$( this ).bind().click( function (){
i=index;
if (inter!= null || inter.length>0){
window.clearInterval(inter);
}
window.setTimeout( function (){
inter=window.setInterval( function (){ $( "img" ).eq(i).show().fadeOut(100).fadeIn(100);},500);
window.setTimeout( function (){
window.clearInterval(inter);
},5000);
},5000);
});
});
window.setTimeout( function (){
inter=window.setInterval( function (){ $( "img" ).eq(i).show().fadeOut(100).fadeIn(100);},500);
window.setTimeout( function (){
window.clearInterval(inter);
},5000);
},5000);
});
|