Este artículo describe el método para implementar el efecto de rollo cronometrado de la imagen JS. Compártelo para su referencia, como sigue:
< xmlns = "http://www.w3.w3.org/19999/xhtml">> <Head> <meta http-equiv = "content-type" content = "text/html; charset = utf-8"/> <meta http-oquiv. efecto </title> <style type = "text/css"> .Father {posición: relativo; desbordamiento: oculto; Altura: 100px; Ancho: 300px; } .Box {float: izquierda; tamaño de fuente: 12px; Ancho: 80px; Altura: 120px; desbordamiento: oculto; Posición: Absoluto; } </style> <script language = "javascript" type = "text/javascript"> var t; Window.Onload = function () {var o = document.getElementById ('box'); t = window.setInterval (function () {scrollup (o, 24, 0);}, 3000)} /// Método principal de desplazamiento /// Parámetros: o Objeto de bloque de scroll /// parámetros: D Altura de cada desplazamiento /// Parámetros de altura actual Scrollup (O, D, c) {if (d == (C - 78)) getFirstChild (O.FirstChild) .clonenode (verdadero); o.removechild (getFirstchild (O.FirstChild)); O.AppendChild (t); T.Style.MarGintOp = "0px"; } else {c += 1; getFirstChild (O.FirstChild) .Style.MarGintOp = -C + "PX"; Window.setTimeOut (function () {scrollup (o, d, c)}, 15); }} // Resuelve el problema de que los espacios se devuelven como nodos en la función de Firefox getFirstChild (nodo) {while (node.nodeType! = 1) {node = node.nextSibling; } nodo de retorno; } </script> </head> <body> Demostración del efecto de sincronización de desplazamiento <hr> <div> <div id = "box"> <div> <img src = "../ img/head/1.png"/> </div> <div> <img src = "../ img/head/2.png"/> </div> <iv> <viv> <img src = " </div> <div> <img src = "../ img/head/4.png"/> </div> </div> </div> </body> </html>For more information about JavaScript related content, please check out the topics of this site: "Summary of JavaScript switching effects and techniques", "Summary of JavaScript search algorithm skills", "Summary of JavaScript animation effects and techniques", "Summary of JavaScript errors and debugging techniques", "Summary of JavaScript data structures and algorithm skills", "Summary of JavaScript Algoritmos y técnicas de recorrido ", y" Resumen del uso de operaciones matemáticas de JavaScript "
Espero que este artículo sea útil para la programación de JavaScript de todos.