<٪@ page language = "java" import = "java.util.*" pageencoding = "utf-8" ٪> <! "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"><html xmlns =" http://www.w3.org/1999/xhtml "> <head> charset = gb2312 "/> <title> 图片滚动 </title> </head> <body> <style> type =" text/css "> <!- #demo {background: #fff ؛ overflow: hidden ؛ border: 1px schated #ccc ؛ width: 1000px ؛ اليسار ؛ العرض: 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 = "images/小美景 4.jpg"/> </a> <a href = ) tab2 = document.getElementById ("demo2") ؛ tab2.innerhtml = tab1.innerhtml ؛ function marquee () {if (tab2.offsetwidth-tab.scrollleft <= 0) tab.scrollleft- = tab1.offsetwidthelse {tab.scrollft ++ ؛} mymar = setInterval (marquee ، speed) ؛ tab.onmouseover = function () {clearinterval (mymar)} ؛ tab.onmouseout = function () {mymar = setInterval (marquee ، speed)} ؛ </script> </body> </html>