有什么问题请到评论中发表<br> <!--# 特效来源:http://www.mb5u.com/jscode --> <!-- 把下面代码加到<body>区域中 --> <table> <tr><td style="padding: 5"> <div id="testDiv" style="border: buttonface 2 solid"> <img src="/img/200407091.jpg"> </div> <script language="JScript"> function scroll(obj, oWidth, oHeight, direction, drag, zoom, speed) { var scrollDiv = obj var scrollContent = document.createElement("span") scrollContent.style.position = "absolute" scrollDiv.applyElement(scrollContent, "inside") var displayWidth = (oWidth != "auto" && oWidth ) ? oWidth : scrollContent.offsetWidth + parseInt(scrollDiv.currentStyle.borderRightWidth) var displayHeight = (oHeight != "auto" && oHeight) ? oHeight : scrollContent.offsetHeight + parseInt(scrollDiv.currentStyle.borderBottomWidth) var contentWidth = scrollContent.offsetWidth var contentHeight = scrollContent.offsetHeight var scrollXItems = Math.ceil(displayWidth / contentWidth) + 1 var scrollYItems = Math.ceil(displayHeight / contentHeight) + 1 scrollDiv.style.width = displayWidth scrollDiv.style.height = displayHeight scrollDiv.style.overflow = "hidden" scrollDiv.setAttribute("state", "stop") scrollDiv.setAttribute("drag", drag ? drag : "horizontal") scrollDiv.setAttribute("direction", direction ? direction : "left") scrollDiv.setAttribute("zoom", zoom ? zoom : 1) scrollContent.style.zoom = scrollDiv.zoom var scroll_script = "var scrollDiv = " + scrollDiv.uniqueID +"\n"+ "var scrollObj = " + scrollContent.uniqueID +"\n"+ "var contentWidth = " + contentWidth + " * (scrollObj.runtimeStyle.zoom ? scrollObj.runtimeStyle.zoom : 1)" +"\n"+ "var contentHeight = " + contentHeight + " * (scrollObj.runtimeStyle.zoom ? scrollObj.runtimeStyle.zoom : 1)" +"\n"+ "var scrollx = scrollObj.runtimeStyle.pixelLeft" +"\n"+ "var scrolly = scrollObj.runtimeStyle.pixelTop" +"\n"+ "switch (scrollDiv.state.toLowerCase())" +"\n"+ "{" +"\n"+ "case ('scroll') :" +"\n"+ "switch (scrollDiv.direction)" +"\n"+ "{" +"\n"+ "case ('left') :" +"\n"+ "scrollx = (--scrollx) % contentWidth" +"\n"+ "break" +"\n"+ "case ('right') :" +"\n"+ "scrollx = -contentWidth + (++scrollx) % contentWidth" +"\n"+ "break" +"\n"+ "case ('up') :" +"\n"+ "scrolly = (--scrolly) % contentHeight" +"\n"+ "break" +"\n"+ "case ('down') :" +"\n"+ "scrolly = -contentHeight + (++scrolly) % contentHeight" +"\n"+ "break" +"\n"+ "case ('left_up') :" +"\n"+ "scrollx = (--scrollx) % contentWidth" +"\n"+ "scrolly = (--scrolly) % contentHeight" +"\n"+ "break" +"\n"+ "case ('left_down') :" +"\n"+ "scrollx = (--scrollx) % contentWidth" +"\n"+ "scrolly = -contentHeight + (++scrolly) % contentHeight" +"\n"+ "break" +"\n"+ "case ('right_up') :" +"\n"+ "scrollx = -contentWidth + (++scrollx) % contentWidth" +"\n"+ "scrolly = (--scrolly) % contentHeight" +"\n"+ "break" +"\n"+ "case ('right_down') :" +"\n"+ "scrollx = -contentWidth + (++scrollx) % contentWidth" +"\n"+ "scrolly = -contentHeight + (++scrolly) % contentHeight" +"\n"+ "break" +"\n"+ "default :" +"\n"+ "return" +"\n"+ "}" +"\n"+ "scrollObj.runtimeStyle.left = scrollx" +"\n"+ "scrollObj.runtimeStyle.top = scrolly" +"\n"+ "break" +"\n"+ "case ('stop') :" +"\n"+ "case ('drag') :" +"\n"+ "default :" +"\n"+ "return" +"\n"+ "}" var contentNode = document.createElement("span") contentNode.runtimeStyle.position = "absolute" contentNode.runtimeStyle.width = contentWidth scrollContent.applyElement(conte</body></html>