<%@ 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"><head><meta http-equiv="Content-Type" content="text/html; charset = gb2312 "/> <tite> 图片滚动 </title> </head> <body> <style type =" text/css "> <!- #demo {ancome: #fff; overflow: hidden; граница: 1px dhated #cc; width: 1000px;} #demo img {10px #f2f2; Слева; Ширина: 800%;}#demo1 {float: left;}#demo2 {float: слева;}-> </style> <div id = "demo"> <div id = "indemo"> <div id = "demo1"> <a href = "#"> <img src = "Images/小美景 1.jpg"/> </a> <a href = "> <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 = "#"> <img src = "j. /> </a> <a href = "#"> <img src = "Images/小美女 2.jpg"/> </a> </div> <div id = "demo2"> </div> </div> </div> <script> var speed = 50; var tab = decietelement ("demo"); tab2 = document.getElementById ("demo2"); tab2.innerhtml = tab1.innerhtml; function marquee () {if (tab2.oftwidth-tab.scrollleft <= 0) tab.scrollleft- = tab1.offsetwidthelse {tab.scrollleft ++; Mymar = setInterval (marquee, speed); tab.onmouseover = function () {clearInterval (mymar)}; tab.onmouseout = function () {mymar = setInterval (марки, скорость)}; </script> </body> </html>