jqueryマルチマップの交代を実現

2938 ワード

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
28
29
30< script  type = "text/javascript" > var t; var speed=2; var i=0; function qiehuan(){ var size=$("#all").find("div").length; $("#all").find("div").hide(); $("#all").find("div").eq(i).show(); i = i+1 == size ?0:i+1; t=setTimeout("qiehuan()",speed*1000); } onload=function(){qiehuan();}; $(document).ready(function(){ $("#all").hover(function(){ clearInterval(t); }); $("#all").mouseleave(function(){ qiehuan(); }); }); </ script >    </ head >        < body >      < div  id = "all"  style = "float:left; position:relative;overflow:hidden;width:300px;height:240px;" >      < div >< img  width = "300"  height = "240"  src=\'#\'" /images/1.jpg"  alt = "1"  /></ div >      < div >< img  width = "300"  height = "240"  src=\'#\'" /images/2.gif"  alt = "2" /></ div >      < div >< img  width = "300"  height = "240"  src=\'#\'" /images/Winter.jpg"  alt = "3" /></ div >      </ div >    </ body >  
私の個人サイト萌えるIT人へようこそ