×

Loading...
Ad by
  • 推荐 OXIO 加拿大高速网络,最低月费仅$40. 使用推荐码 RCR37MB 可获得一个月的免费服务
Ad by
  • 推荐 OXIO 加拿大高速网络,最低月费仅$40. 使用推荐码 RCR37MB 可获得一个月的免费服务

an sample for you

This function only implement image move from left to right. You can modify the code to fulfill your function.

<SCRIPT LANGUAGE=javascript>
<!--
var pos = -95;
var speed = Math.floor(Math.random () * 10) + 2;
function movet()
{
pos += speed;

if (pos > 795) pos = -95;

document.getElementById("mouse").style.left = pos;
window.setTimeout("next();", 30);
}

<BODY onLoad = "move();">
<div ID = "mouse" style = "HEIGHT: 100px; LEFT:
0px; POSITION: absolute; TOP: 170px; WIDTH: 100px">
<a href = "http://www.mouse.com" target = "nnn">
<IMG alt = "click me" border = 0 height = 100 src = "mouse.gif" width=100 onMouseOver="showWord();" onMouseOut="hideWord()">
</a>
</div>
Report

Replies, comments and Discussions:

  • 工作学习 / IT技术讨论 / 求助:我们老板一定要我在公司的网页上作一个图片的移动。就是图片平稳的左移再右移,感觉好像是人在往左往右看似的。请问在何处可以找到制作工具或制作教程。谢谢了。
    • Java script?
      • 好像是用它,我还在flash mx里猛找呢。哪位有经验的dx出来详细说说
        • 你去cn.yahoo.com,最右边有个广告图片上下的跑,是不是你想要的效果?
        • an sample for you
          This function only implement image move from left to right. You can modify the code to fulfill your function.

          <SCRIPT LANGUAGE=javascript>
          <!--
          var pos = -95;
          var speed = Math.floor(Math.random () * 10) + 2;
          function movet()
          {
          pos += speed;

          if (pos > 795) pos = -95;

          document.getElementById("mouse").style.left = pos;
          window.setTimeout("next();", 30);
          }

          <BODY onLoad = "move();">
          <div ID = "mouse" style = "HEIGHT: 100px; LEFT:
          0px; POSITION: absolute; TOP: 170px; WIDTH: 100px">
          <a href = "http://www.mouse.com" target = "nnn">
          <IMG alt = "click me" border = 0 height = 100 src = "mouse.gif" width=100 onMouseOver="showWord();" onMouseOut="hideWord()">
          </a>
          </div>
        • sorry, two wrongs in my previous post
          Following is correct.

          <SCRIPT LANGUAGE=javascript>
          <!--
          var pos = -95;
          var speed = Math.floor(Math.random () * 10) + 2;
          function move()
          {
          pos += speed;

          if (pos > 795) pos = -95;

          document.getElementById("mouse").style.left = pos;
          window.setTimeout("move();", 30);
          }

          <BODY onLoad = "move();">
          <div ID = "mouse" style = "HEIGHT: 100px; LEFT:
          0px; POSITION: absolute; TOP: 170px; WIDTH: 100px">
          <a href = "http://www.mouse.com" target = "nnn">
          <IMG alt = "click me" border = 0 height = 100 src = "mouse.gif" width=100 onMouseOver="showWord();" onMouseOut="hideWord()">
          </a>
          </div>
    • CSS虑镜可以实现这个功能。不过好久没有用,你可以找找
      • only works in IE
    • I used it when I made my homepage,use javascript. First make a layer, show it, settimeout, then hide it, make a new layer in new place...
      • only works for Netscape.
    • 我最讨厌这玩意在网页上晃来晃去了
    • 用Dreamweave画一下,会自动生成Javascript