Home >Web Front-end >JS Tutorial >Display and switch the function of adding text after image mosaic implemented using javascript_Image special effects
| |
|
| |
<script> <br><br>var slidespeed=3000 <br><br>var slideimages=new Array("http://www.blueidea.com/articleimg/upload/2006/3/5/2482150_1_7.jpg","http://www.blueidea.com/articleimg/upload/2006/3/5/2482150_2_1.jpg","http://www.blueidea.com/articleimg/upload/2006/3/5/2482150_3_2.jpg","http://www.blueidea.com/articleimg/upload/2006/3/5/2482150_3_2.jpg","http://www.blueidea.com/articleimg/upload/2006/3/5/2482150_3_2.jpg") <br><br>var texts = new Array ("11111","22222","33333","44444","55555") <BR>var texts1 = new Array ("11111","22222","33333","44444","55555") <BR>var texts2 = new Array ("11111","22222","33333","44444","55555") <BR>var imageholder=new Array() <BR>var ie55=window.createPopup <BR>for (i=0;i<slideimages.length;i++){ <BR>imageholder[i]=new Image(); <BR>imageholder[i].src=slideimages[i]; <br><br>} <br><br>function gotoshow(){ <BR>window.location=slidelinks[whichlink] <BR>} <br><br>//--> <BR></script> <script> <BR><!-- <BR>var whichlink=0 <BR>var whichimage=0 <BR>var pixeldelay=(ie55)? document.images.slide.filters[0].duration*1000 : 0 <BR>function slideit(){ <BR>if (!document.images) return <BR>whichlink=whichimage; <BR>if(whichimage<slideimages.length){ <BR>whichimage=whichimage+1; <BR>}else{whichimage=1} <BR>/* <BR>whichimage=(whichimage<slideimages.length-1)? whichimage+1 : 0; <BR>whichimage=(whichimage>=slideimages.length)?whichimage=slideimages.length:whichimage; <BR>*/ <BR>if (ie55) document.images.slide.filters[0].apply() <BR>var thesrc=(whichimage-1)>0?thesrc=whichimage-1:0 <BR>document.images.slide.src=imageholder[thesrc].src <BR>if (ie55) document.images.slide.filters[0].play() <BR>text.innerText=(whichimage<slideimages.length+1)? texts[whichimage-1] : 0; <BR>aa.innerText= whichimage; <BR>text1.innerText=(whichimage<slideimages.length+1)? texts1[whichimage-1] : 0; <BR>text2.innerText=(whichimage<slideimages.length+1)? texts2[whichimage-1] : 0; <BR>setTimeout("slideit()",slidespeed+pixeldelay) <BR>} <BR>slideit() <br><br>//--> <BR></script> |