บทความนี้อธิบายถึงวิธีการใช้เอฟเฟกต์ม้วนที่กำหนดเวลาของภาพ JS แบ่งปันสำหรับการอ้างอิงของคุณดังนี้:
<! doctype html public "-// w3c // dtd xhtml 1.0 transitional // en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns = "http://www.w3.org/1999/xhtml"> <head> <meta http-equiv = "content-type" content = "text/html; charset = utf-8"/> <meta http-equiv = "x-ua-comtible" เอฟเฟกต์ </title> <style type = "text/css">. father {ตำแหน่ง: ญาติ; ล้น: ซ่อน; ความสูง: 100px; ความกว้าง: 300px; } .Box {Float: ซ้าย; ขนาดตัวอักษร: 12px; ความกว้าง: 80px; ความสูง: 120px; ล้น: ซ่อน; ตำแหน่ง: สัมบูรณ์; } </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)} /// วิธีการเลื่อนหลัก ////////////////////////////////////////////ife) GetFirstChild (O.FirstChild) .ClonEnode (จริง); 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); }} // แก้ปัญหาที่ช่องว่างจะถูกส่งคืนเป็นโหนดในฟังก์ชัน firefox getFirstChild (โหนด) {ในขณะที่ (node.nodeType! = 1) {node = node.nextsibling; } ส่งคืนโหนด; } </script> </head> <body> การสาธิตเอฟเฟกต์การกำหนดเวลาเลื่อนลอย <hr> <div> <div id = "box"> <div> <img src = "../ img/head/1.png"/> </div> <div> <img src = " </div> <div> <img src = "../ img/head/4.png"/> </div> </div> </div> </body> </html>สำหรับข้อมูลเพิ่มเติมเกี่ยวกับเนื้อหาที่เกี่ยวข้องกับ JavaScript โปรดตรวจสอบหัวข้อของไซต์นี้: "สรุปเอฟเฟกต์และเทคนิคการสลับ JavaScript", "สรุปทักษะอัลกอริธึมการค้นหา JavaScript", "สรุปผลการสรุปและเทคนิคการสรุปของ JavaScript ของ JavaScript อัลกอริทึมและเทคนิคการสำรวจ JavaScript "และ" สรุปการใช้งานทางคณิตศาสตร์ JavaScript "
ฉันหวังว่าบทความนี้จะเป็นประโยชน์กับการเขียนโปรแกรม JavaScript ของทุกคน