This article is an example of the implementation of JS graphics and link text synchronization switch effect method. Share to everyone for your reference. The implementation methods are as follows:
Copy Code code as follows:
<title>js picture and link text sync switch effects </title>
<script language=javascript>
var imgurl=new Array ();
var imglink=new Array ();
var imgtz=new Array ();
var adnum=0;
Imgurl[1]= "/images/m01.jpg";
Imglink[1]= "Http://www.jb51.net";
imgtz[1]= "<a href=#><font color=white> text link content a red leaf teaser </font></a>";
Imgurl[2]= "/images/m02.jpg";
Imglink[2]= "Http://www.jb51.net";
imgtz[2]= "<a href=#><font color=white> text link contents Two wildflowers bloom </font></a>";
Imgurl[3]= "/images/m03.jpg";
Imglink[3]= "Http://www.jb51.net";
imgtz[3]= "<a href=#><font color=white> text link content three past events such as tea </font></a>";
var j=0;
for (i=1;i<=3;i++) {
if ((imgurl[i]!= "") && (imglink[i]!= "")) {
j + +;
} else {
Break
}
}
function Playtran () {
if (document.all)
ImgInit.filters.revealTrans.play ();
}
var key=0;
function Nextad () {
if (adnum<j) adnum++;
else Adnum=1;
if (key==0) {
Key=1;
else if (document.all) {
imginit.filters.revealtrans.transition=6;
ImgInit.filters.revealTrans.apply ();
Playtran ();
}
Document.images.imginit.src=imgurl[adnum];
document.getElementById (' Jdtz '). Innerhtml=imgtz[adnum];
Thetimer=settimeout ("Nextad ()", 3000);
}
function Gourl () {
Jumpurl=imglink[adnum];
jumptarget= ' _blank ';
if (Jumpurl!= ') {
if (Jumptarget!= ')
window.open (Jumpurl,jumptarget);
Else
Location.href=jumpurl;
}
}
</script>
<body>
<table><tr><td> <a href= "Javascript:gourl ()" ></a> </td></tr> <TR><TD id=jdtz bgcolor= "Blue" ></td></tr></table>
</body>
I hope this article will help you with your JavaScript programming.