Este artículo describe el método de los efectos de conmutación sincrónicos de JS en el texto de imagen y enlace. Compártelo para su referencia. El método de implementación específico es el siguiente:
Copie el código de la siguiente manera: <html>
<title> JS Pictures y Link Text Efectos de conmutación sincrónicos </title>
<Evista>
<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] = "// www.vevb.com";
imgtz [1] = "<a href =#> <font color = white> contenido de enlace de texto con hojas rojas </font> </a>";
imgurl [2] = "/images/m02.jpg";
imglink [2] = "// www.vevb.com";
imgtz [2] = "<a href =#> <font color = white> contenido de enlace de texto: segunda flores silvestres floración </font> </a>";
imgurl [3] = "/imágenes/m03.jpg";
imglink [3] = "// www.vevb.com";
imgtz [3] = "<a href =#> <font color = white> contenido de enlace de texto tres eventos pasados son como té </font> </a>";
var j = 0;
para (i = 1; i <= 3; i ++) {
if ((imgurl [i]! = "") && (imglink [i]! = "")) {
j ++;
} demás {
romper;
}
}
function playTran () {
if (document.all)
imginit.filters.revealtrans.play ();
}
varilla var = 0;
función nextad () {
if (adnum <j) adnum ++;
else adnum = 1;
if (key == 0) {
clave = 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);
}
función gourl () {
Jumpurl = imglink [adnum];
jumpPetget = '_ en blanco';
if (Jumpurl! = '') {
if (jumpPetget! = '')
Window.open (Jumpurl, jumpPetget);
demás
ubicación.href = JUTURL;
}
}
</script>
</ablo>
<Body>
<Ably> <tr> <TD> <a href = "javaScript: gourl ()"> <img style = "Filtro: revelatrans (duración = 2, transición = 20); border = 0" src = "javascript: nextad ()" width = 320 height = 240 border = 0 name = imginit> </a> </td> </tr> <tr> <tr> <tr> bgcolor = "Blue"> </td> </tr> </table>
</body>
</html>
Espero que este artículo sea útil para la programación de JavaScript de todos.