求纯js 图片切换代码,最好带注释!

求纯js图片切换代码,最好带注释!方便修改使用!如果好用会送附加分。最好下面有文字可以跟着切换的... 求纯js 图片切换代码,最好带注释!方便修改使用!
如果好用会送附加分。
最好下面有文字可以跟着切换的
展开
 我来答
紫殇沫落
推荐于2016-11-01 · TA获得超过1506个赞
知道小有建树答主
回答量:429
采纳率:0%
帮助的人:478万
展开全部
现在所有图片都是放在images文件家里的。

你的图片要是不是放在images文件夹里的话,比如要放在tupian文件夹里,你就在dw里替换所有images字符为tupian,就能显示小箭头了啊

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0055)http://www.dazhuer.cn/other/jscode/imglh/ad17/index.htm -->
<HTML><HEAD><TITLE>无标题文档</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<STYLE type=text/css>BODY {
TEXT-ALIGN: center
}
TD {
FONT-SIZE: 12px
}
#textslide {
COLOR: #333333
}
</STYLE>

<META content="MSHTML 6.00.6000.16825" name=GENERATOR></HEAD>
<BODY>
<TABLE cellSpacing=0 cellPadding=0 width=325 border=0>
<TBODY>
<TR vAlign=top>
<TD colSpan=3><A onmouseover=tu_ove() style="CURSOR: hand"
onclick=gotoshow() onmouseout=ou()><IMG height=190 src="images/ad-01.jpg"
width=325 border=0 name=slide></A></TD></TR>
<TR>
<TD class=white align=middle width=229 bgColor=#f4f4f4 height=19></TD>
<TD width=1 bgColor=#7c7c7c>
<DIV style="POSITION: relative">
<DIV style="POSITION: absolute; TOP: 10px">
<TABLE cellSpacing=0 cellPadding=0 width=95 border=0>
<TBODY>
<TR vAlign=top align=middle>
<TD width=19 height=0>
<DIV style="POSITION: relative">
<DIV id=xiaotu1
style="LEFT: 0px; POSITION: absolute; TOP: -19px"><IMG id=xiaosan1
height=3 src="images/bian1.gif" width=10 border=0></DIV></DIV></TD>
<TD width=19 height=0>
<DIV style="POSITION: relative">
<DIV id=xiaotu2
style="LEFT: 0px; POSITION: absolute; TOP: -19px"><IMG id=xiaosan2
height=3 src="images/bian1.gif" width=10></DIV></DIV></TD>
<TD width=19 height=0>
<DIV style="POSITION: relative">
<DIV id=xiaotu3
style="LEFT: 0px; POSITION: absolute; TOP: -19px"><IMG id=xiaosan3
height=3 src="images/bian1.gif" width=10></DIV></DIV></TD>
<TD width=19 height=0>
<DIV style="POSITION: relative">
<DIV id=xiaotu4
style="LEFT: 0px; POSITION: absolute; TOP: -19px"><IMG id=xiaosan4
height=3 src="images/bian1.gif" width=10></DIV></DIV></TD>
<TD width=19 height=0>
<DIV style="LEFT: 1px; POSITION: relative">
<DIV id=xiaotu5
style="LEFT: 0px; POSITION: absolute; TOP: -19px"><IMG id=xiaosan5
height=3 src="images/bian1.gif"
width=10></DIV></DIV></TD></TR></TBODY></TABLE></DIV></DIV></TD>
<TD width=95 height=19>
<TABLE cellSpacing=0 cellPadding=0 width=95 border=0>
<TBODY>
<TR vAlign=top>
<TD class=homejdboder width=19 height=19><A onmouseover=ove(0)
style="CURSOR: hand" onmouseout=ou()><IMG height=19
src="images/1.gif" width=19 border=0></A></TD>
<TD class=homejdboder width=19 height=19><A onmouseover=ove(1)
style="CURSOR: hand" onmouseout=ou()><IMG height=19
src="images/2.gif" width=19 border=0></A></TD>
<TD class=homejdboder width=19 height=19><A onmouseover=ove(2)
style="CURSOR: hand" onmouseout=ou()><IMG height=19
src="images/3.gif" width=19 border=0></A></TD>
<TD class=homejdboder width=19 height=19><A onmouseover=ove(3)
style="CURSOR: hand" onmouseout=ou()><IMG height=19
src="images/4.gif" width=19 border=0></A></TD>
<TD width=19 height=19><A onmouseover=ove(4) style="CURSOR: hand"
onmouseout=ou()><IMG height=19 src="images/5.gif" width=19
border=0></A></TD></TR></TBODY></TABLE></TD></TR><tr><td colspan="3">
<DIV id=textslide>焦点图标题层</DIV></td></tr></TBODY></TABLE>
<SCRIPT>
//slideimages数组为变换的图
var slideimages=new Array();
slideimages[0]="images/ad-01.jpg";
slideimages[1]="images/ad-02.jpg";
slideimages[2]="images/ad-03.jpg";
slideimages[3]="images/ad-04.jpg";
slideimages[4]="images/ad-05.jpg";

//slidetext数组为变换的文字
var slidetext=new Array();
slidetext[0]="焦点图片广告011111";
slidetext[1]="焦点图片广告022222";
slidetext[2]="焦点图片广告033333";
slidetext[3]="焦点图片广告044444";
slidetext[4]="焦点图片广告055555";

//slidetext数组为点击大图后跳到的地址
var slidelinks=new Array();
slidelinks[0]="http://www.webkkk.com/sygj/ggdm.htm";
slidelinks[1]="http://www.webkkk.com/sygj/ggdm.htm";
slidelinks[2]="http://www.webkkk.com/sygj/ggdm.htm";
slidelinks[3]="http://www.webkkk.com/sygj/ggdm.htm";
slidelinks[4]="http://www.webkkk.com/sygj/ggdm.htm";

//焦点图初始内容--start
var slidespeed=3000

var slidesanjiaoimages=new Array("images/bian2.gif","images/bian1.gif");
var slidesanjiaoimagesname=new Array("xiaosan1","xiaosan2","xiaosan3","xiaosan4","xiaosan5");

var filterArray=new Array();
filterArray[0]="progid:DXImageTransform.Microsoft.Pixelate (enabled=false,duration=2,maxSquare=25 )";
filterArray[1]="progid:DXImageTransform.Microsoft.Stretch (duration=1,stretchStyle=PUSH)";
filterArray[2]="progid:DXImageTransform.Microsoft.Stretch(duration=1)";
filterArray[3]="progid:DXImageTransform.Microsoft.Slide(bands=8, duration=1)";
filterArray[4]="progid:DXImageTransform.Microsoft.Fade ( duration=1,overlap=0.25 )";

var imageholder=new Array()
var ie55=window.createPopup
for (i=0;i<slideimages.length;i++){
imageholder[i]=new Image()
imageholder[i].src=slideimages[i]
}

function tu_ove(){clearTimeout(setID)}
function ou(){slideit()}

var whichlink=0
var whichimage=0

function gotoshow(){
window.open(slidelinks[whichlink]);
}

function slideit(){

document.images.slide.style.filter=filterArray[whichimage];
//alert(document.images.slide.style.filter);
pixeldelay=(ie55)? (document.images.slide.filters[0].duration*1000) : 0
//alert(pixeldelay);
if (!document.images) return

if (ie55) {
document.images.slide.filters[0].apply();
document.images.slide.filters[0].play();

}
document.images.slide.src=imageholder[whichimage].src

document.getElementById("textslide").innerText=slidetext[whichimage];

document.getElementById("xiaosan1").src=slidesanjiaoimages[0];
document.getElementById("xiaosan2").src=slidesanjiaoimages[0];
document.getElementById("xiaosan3").src=slidesanjiaoimages[0];
document.getElementById("xiaosan4").src=slidesanjiaoimages[0];
document.getElementById("xiaosan5").src=slidesanjiaoimages[0];

document.getElementById(slidesanjiaoimagesname[whichimage]).src=slidesanjiaoimages[1];

if (ie55) document.images.slide.filters[0].play()
whichlink=whichimage
whichimage=(whichimage<slideimages.length-1)? whichimage+1 : 0
setID=setTimeout("slideit()",slidespeed+pixeldelay)
}
slideit()
function ove(n){
clearTimeout(setID)
whichimage=n;
document.images.slide.src=imageholder[whichimage].src

document.getElementById("textslide").innerText=slidetext[whichimage];
document.getElementById("xiaosan1").src=slidesanjiaoimages[0];
document.getElementById("xiaosan2").src=slidesanjiaoimages[0];
document.getElementById("xiaosan3").src=slidesanjiaoimages[0];
document.getElementById("xiaosan4").src=slidesanjiaoimages[0];
document.getElementById("xiaosan5").src=slidesanjiaoimages[0];
document.getElementById(slidesanjiaoimagesname[whichimage]).src=slidesanjiaoimages[1];
}

</SCRIPT>
</BODY></HTML>
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式