中文(繁体)
<!--完整的HTML程式碼如下:--> <html> <head> <script language="JavaScript"> <!-- ns4 = (document.layers)? true:false ie4 = (document.all)? true:false function init() { if (ns4) block = document.blockDiv if (ie4) block = blockDiv.style block.xpos = parseInt(block.left) block.active = false } function slide() { if (block. .active) { block.xpos += 5 block.left = block.xpos setTimeout("slide()",30) } } //--> </script> </head> <body bgcolor="#FFFFFF" onLoad="init()"> <p>點選或按下不動以下連結使物件移動。 </p> <p><a href="javascript:void(null)" onMouseDown="block.active=true; slide(); return false;" onMouseUp="block.active=false" onMouseOut="block. active=false">移動</a> </p> <div id="blockDiv" style="position:absolute; left:50px; top:100px; width:30px; height:30px; clip:rect(0px 30px 30px 0px); layer-background-color:red; background-color:red;"> </div> </body> </html>