Dieser Artikel beschreibt die Methode zur Implementierung des zeitgesteuerten Roll -Effekts des JS -Bildes. Teilen Sie es für Ihre Referenz wie folgt weiter:
<! DocType html public "-// w3c // dtd xhtml 1.0 transitional // en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transsitional.dtd"> <html xmlns = "http://www.w3.org/1999/xhtml"> <head> <meta http-equiv = "content-type" content = "text/html; charset = utf-8"/> <meta http-äquiv = "x-ua-ua-kompatible" content Effekt </title> <style type = "text/css"> .father {Position: Relativ; Überlauf: versteckt; Höhe: 100px; Breite: 300px; } .box {float: links; Schriftgröße: 12px; Breite: 80px; Höhe: 120px; Überlauf: versteckt; Position: absolut; } </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)} /// Scroll -Hauptmethode /// Parameter: o Scroll -Blockobjekt /// Parameter: D Höhe jeder Scroll /// Parameter: C Stromer -Scrolled -Funktions -Scrollup (O, D, C) {if (d == (d ==) (d == (d ==) (d == (d ==) (d == (d ==) (d == (d ==) (d == (d ==) (d == (d ==) (d == (d ==) (d == (d ==) (d == (d ==) (d == (d == () (d == (d ==) (d == (d ==) ((d ==) ((d == )ufit GetFirstchild (O.Firstchild) .Clonenode (true); 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); }} // Lösen Sie das Problem, dass Leerzeichen als Knoten in der Firefox -Funktion getFirstchild (Knoten) {while (node.nodeType! = 1) {node = node.nextsibling; } Return Node; } </script> </head> <body> Scroll timing effect demonstration<hr> <div> <div id="box"> <div> <img src="../img/head/1.png"/> </div> <div> <img src="../img/head/2.png"/> </div> <div> <img src="../img/head/3.png"/> </div> <div> <img src = "../ img/head/4.png"/> </div> </div> </div> </body> </html>Weitere Informationen zu javaScriptbezogenen Inhalten finden Sie in den Themen dieser Website: "Zusammenfassung der JavaScript -Switching -Effekte und -Techniken", "Zusammenfassung der Fähigkeiten der JavaScript -Suchalgorithmus", "Zusammenfassung der JavaScript -Animationseffekte und -Techniken", "Zusammenfassung von JavaScript -Fehler und Debugging -Techniken", Summary of Javacript -Daten und Algorith -Fähigkeiten "," Summary of Javacript Data Structures "," Summary of Javacript Data Structures "" "" "" "" "" "" "" "" "" " JavaScript -Traversalalgorithmen und -techniken "und" Zusammenfassung der Nutzung von JavaScript -Mathematischen Operationen "
Ich hoffe, dieser Artikel wird für JavaScript -Programme aller hilfreich sein.