<%@ page language = "java" import = "java.util.*" pageencoding = "utf-8"%> <! 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 " charset = gb2312 "/> <title> 图片滚动 </title> </head> <body> <style type =" text/css "> <!- #demo {พื้นหลัง: #FFF; overflow: Hidden; Border: 1px Dashed #ccc; width: 1000px; ซ้าย; Width: 800%;}#demo1 {float: left;}#demo2 {float: left;}-> </style> <div id = "demo"> <div id = "indemo"> <div id = "demo1"> <a href = "#"> src = "images/小美景 2.jpg"/> </a> <a href = "#"> <img src = "images/小美景 3.jpg"/> </a> <a href = "#"> <img src = "ภาพ/小美景 4.jpg"/> /> </a> <a href = "#"> <img src = "รูปภาพ/小美女 2.jpg"/> </a> </v> <div id = "demo2"> </div> </div> </div> tab2 = document.getElementById ("demo2"); tab2.innerhtml = tab1.innerhtml; function marquee () {ถ้า (tab2.offsetwidth-tab.scrollleft <= 0) tab.scrollleft-= tab1.offsetwidthelse {tab.scrollleft mymar = setInterval (marqueee, speed); tab.onmouseover = function () {clearInterval (mymar)}; tab.onmouseout = function () {mymar = setInterval (marquee, ความเร็ว)}; </script> </body> </html>