(带缩略图版)JS图片切换代码
- 时间:2015年04月02日 11:00:10 来源:魔法猪系统重装大师官网 人气:14226
href="/" target=_blank> src="/jscss/demoimg/wall1.jpg" width="450" height="335" />
<script language=javascript type=text/javascript> var picarry = {}; var lnkarry = {}; var ttlarry = {}; picarry[0] = "http://www.codefans.net/jscss/demoimg/wall1.jpg"; lnkarry[0] = "/"; ttlarry[0] = "图一"; picarry[1] = "/jscss/demoimg/wall2.jpg"; lnkarry[1] = "/"; ttlarry[1] = "图二"; picarry[2] = "/jscss/demoimg/wall3.jpg"; lnkarry[2] = "/"; ttlarry[2] = "图三"; picarry[3] = "/jscss/demoimg/wall4.jpg"; lnkarry[3] = "/"; ttlarry[3] = "图四"; picarry[4] = "/jscss/demoimg/wall5.jpg"; lnkarry[4] = "/"; ttlarry[4] = "图五"; </script>
|
<script type=text/javascript>
var currslid = 0;
var slidint;
function setfoc(id){
document.getElementById("focpic").src = picarry[id];
document.getElementById("foclnk").href = lnkarry[id];
document.getElementById("foctitle").innerHTML = ''+ttlarry[id]+'';
currslid = id;
for(i=0;i<5;i++){
document.getElementById("tmb"+i).className = "thumb_off";
};
document.getElementById("tmb"+id).className ="thumb_on";
focpic.style.visibility = "hidden";
focpic.filters[0].Apply();
if (focpic.style.visibility == "visible") {
focpic.style.visibility = "hidden";
focpic.filters.revealTrans.transition=23;
}
else {
focpic.style.visibility = "visible";
focpic.filters[0].transition=23;
}
focpic.filters[0].Play();
stopit();
}
function playnext(){
if(currslid==4){
currslid = 0;
}
else{
currslid++;
};
setfoc(currslid);
playit();
}
function playit(){
slidint = setTimeout(playnext,4500);
}
function stopit(){
clearTimeout(slidint);
}
window.onload = function(){
playit();
}</script>
带,缩略,图版,图片,切换,代码,以下,是,图片,