Image Moves Right To Left

[Total: 0    Average: 0/5]

This will move an image from right to left on the top of the window.

Body Code:

<SCRIPT LANGUAGE="JScript">
  var id
  function StartGlide()
  {
    document.all.Banner.style.pixelLeft = document.body.offsetWidth;
    id = window.setInterval("Glide()",50);
  }
  function Glide()
  {
    document.all.Banner.style.pixelLeft -= 10;
    if (document.all.Banner.style.pixelLeft <= 0 )
    {
      document.all.Banner.style.pixelLeft = 0 ;
      window.clearInterval(id);
    }
  }
</SCRIPT>
Normally you would have this code in the onload BODY tag.
<a href="javascript:StartGlide()">start this<a/>
<p>
Using Dynamic positioning, you can move images across your page in a number of ways.
<IMG ID="Banner" STYLE="position:absolute; top:10; left:0; z-index:-1" SRC="http://www.js-examples.com/js/pic1.gif">

Times Viewed: 3

Leave a Reply

Your email address will not be published. Required fields are marked *