Este artigo descreve o método de efeitos de comutação síncrona do JS na imagem e no texto do link. Compartilhe para sua referência. O método de implementação específico é o seguinte:
Copie o código da seguinte forma: <html>
<título> imagens js e link efeitos de comutação síncrona de texto </ititle>
<head>
<idioma do script = javascript>
var imgurl = new Array ();
var iMglink = new Array ();
var imgtz = new Array ();
var adnum = 0;
imgurl [1] = "/imagens/m01.jpg";
imglink [1] = "// www.vevb.com";
imgtz [1] = "<a href =#> <font color = white> conteúdo do link de texto com folhas vermelhas </font> </a>";
imgurl [2] = "/imagens/m02.jpg";
imglink [2] = "// www.vevb.com";
imgtz [2] = "<a href =#> <font color = white> conteúdo do link de texto: Second Wild Flowers Bloom </font> </a>";
imgurl [3] = "/imagens/m03.jpg";
imglink [3] = "// www.vevb.com";
imgtz [3] = "<a href =#> <font color = white> conteúdo do link de texto Três eventos anteriores são como chá </font> </a>";
var j = 0;
for (i = 1; i <= 3; i ++) {
if ((imgurl [i]! = "") && (imglink [i]! = "")) {
j ++;
} outro {
quebrar;
}
}
função playtran () {
if (document.all)
imginit.filters.revealtrans.play ();
}
var chave = 0;
função nextad () {
if (adnum <j) adnum ++;
else adnum = 1;
if (key == 0) {
chave = 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);
}
função gourl () {
jumpurl = imglink [adnum];
jumptarget = '_ em branco';
if (jumpurl! = '') {
if (jumptarget! = '')
window.open (jumpurl, jumptarget);
outro
location.href = jumpurl;
}
}
</script>
</head>
<Body>
<table> <tr> <td> <a href = "javascript: gourl ()"> <img style = "filtro: reveretrans (duração = 2, transição = 20); borda = 0" src = "javaScript: nextad ()" width = 320 altura = 240 borda = 0 ° bgcolor = "azul"> </td> </tr> </tabela>
</body>
</html>
Espero que este artigo seja útil para a programação JavaScript de todos.