中文(繁体)
<!-- http://www.downcodes.com --> <!-- bbs http://bbs.downcodes.com --> <!--1、將以下程式碼加入HEML的<head >< /head>之間:--> <script LANGUAGE="JavaScript"><!-- step = 0; obj = 新圖像(); function anim(xp,xk,smer) //smer = 方向 { obj.style.left = x; x += 步驟*smer; if (x>=(xk+xp)/2) { if (smer == 1) 步驟--;否則步驟++; } else { if (smer == 1) 步驟++;否則步驟--; } 如果 (x >= xk) { x = xk; smer = -1; } if (x <= xp) { x = xp; smer = 1; } // 如果 (smer > 2) smer = 3; setTimeout('anim('+xp+','+xk+','+smer+')', 50); } function moveLR(objID,movingarea_width,c) { if (navigator.appName=="Netscape") window_width = window.innerWidth;否則 window_width = document.body.offsetWidth; obj = document.images[objID]; image_width = obj.width; x1 = obj.style.left; x = Number(x1.substring(0,x1.length-2)); // 30px -> 30 if (c == 0) { if (movingarea_width == 0) { right_margin = window_width - image_width;動畫(x,right_margin,1); } else { right_margin = x + movingarea_width - image_width; if (movingarea_width < x + image_width) window.alert("沒有空間可以移動!");否則動畫(x,right_margin,1); } } else { if (movingarea_width == 0) right_margin = window_width - image_width; else { x = Math.round((window_width-movingarea_width)/2); right_margin = Math.round((window_width+movingarea_width)/2)-image_width; } anim(x,right_margin,1); } } //--></script> <!--2、將以下程式碼加入HEML的<body></body>之間:--> <img src="/u/info_img/2009 -06 /20/2809_logo.gif" name="圖片" style="位置:絕對;上方:70px;左側:30px;" BORDER="0" WIDTH="140" HEIGHT="40"> <script LANGUAGE="JavaScript"><!-- setTimeout("moveLR('圖片',300,1)",10); //--></腳本>