ภาษาไทย
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <BODY> <img src="/img/link.gif" width="92" height="34" id ="downcodes1"> <img src="/img/link1.gif" width="92" height="34" id="downcodes2"> <img src="/img/link2.gif" width="92" height="34" id="downcodes3"> <img src="/img/200406301.jpg" width="92" height="34" id="downcodes4"> <SCRIPT LANGUAGE="JavaScript"> GoGoGo(" ดาวน์โค้ด1"); GoGoGo("downcodes3"); GoGoGo("downcodes2"); GoGoGo("downcodes4"); ฟังก์ชั่น GoGoGo (objName) { var img=document.getElementById(objName) ; img.style.position="สัมบูรณ์"; img.style.left=parseInt(window.screen.availWidth*Math.random()) + "px"; img.style.top=parseInt(window.screen.availHeight*Math.random()) + "px"; img.setAttribute("xDir",1);//¶¨Ò忪ʼxµÄ·½Ïò img.setAttribute("yDir",1);/ /¶¨Ò忪ʼxµÄ·½Ïò window.setInterval("randPosition(" + objName + ")", "10", "JavaScript"); } ฟังก์ชั่น randPosition(obj) { var x=parseInt(obj.style.left); ถ้า(x>=window.screen.availWidth-obj.width-20) obj.setAttribute("xDir",-1); ถ้า(x<=0) obj.setAttribute("xDir",1); x+=parseInt(obj.getAttribute("xDir")); var y=parseInt(obj.style.top); ถ้า(y>=window.screen.availHeight-obj.height-100) obj.setAttribute("yDir",-1); ถ้า(y<=0) obj.setAttribute("yDir",1); y+=parseInt(obj.getAttribute("yDir")); obj.style.left=x + "px"; obj.style.top =y + "px"; } </SCRIPT> </BODY> </HTML>