<%@ halaman bahasa = "java" import = "java.util.*" pageEncoding = "UTF-8"%> <! Doctype html public "-// w3c // dtd xhtml 1.0 transisi // en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"><html xmlns =" http://www.w3.org/1999/xhtml "> <pead> <peadp Meta htm = "-ponteP = "-POPLE "-PEPLEPERP = "-POPPEVERP = "-POPPERP = "-" charset = gb2312 "/> <title> 图片滚动 </itement> </head> <body> <style type =" text/css "> <!- #demo {latar belakang: #fff; overflow: hidden; border: 1px putus #ccc; lebar: 1000px;} #demo Img {10px: 10px; Width: 1000px;} #demo IMG {10px: 10px; Width: 1000px;} #demo IMG {10px: 10px; Width: 1000px;} #demo IMG {10px: 10px #f2px; 800%;}#demo1 {float: left;}#demo2 {float: left;}-> </style> <div id = "demo"> <div id = "indemo"> <div id = "demo1"> <a href = "#"> <img src = "gambar/小美景 1.Jpg"/> src = "gambar/小美景 2.jpg"/> </a> <a href = "#"> <img src = "gambar/小美景 3.jpg"/> </a> <a href = "#"> <img src = "gambar/小美景 4.jpg"/</a> <a hrf = "#"#"#"#"iMage =" iMgg "/</a> </a> </a"#"#"#"#" /></a><a href="#"><img src="images/小美女2.jpg" /></a></div><div id="demo2"></div></div></div><script>var speed=50;var tab=document.getElementById("demo");var tab1=document.getElementById("demo1");var tab2 = document.getElementById ("demo2"); tab2.innerHtml = tab1.innerHtml; function marquee () {if (tab2.offsetWidth-tab.scrollleft <= 0) tab.scrollleft- = tab1.offsetWidthelse {tab.scrolllef +++ = Tab1.offsetWidthelse {Tab.scrolllef) {Tab.scrollleft- = Tab1 Mymar = setInterval (marquee, speed); tab.onMouseOver = function () {clearInterval (mymar)}; tab.onmouseout = function () {mymar = setInterval (marquee, speed)}; </script> </body> </html>