animation in html

Posted on 2000-03-09
Last Modified: 2013-11-19
i need a script that enter image to my html doc from top and going out   in a loop
Question by:rutie37

Expert Comment

ID: 2603590
You will find all what you need here:
and here:

But I recomend you to use Dreamweaver to create a path for an image to move around a page.


Expert Comment

ID: 2611110
you can insert image tag for image
<input type="image" src="test.gif">
LVL 22

Expert Comment

ID: 2615438
You will need at least one layer, and javascript code. Dansteinmann is very famous on this kind of stuff.

For IE you have a layer <DIV>, this has a style attribute with the position of the layer. like

<DIV name='moveit' style="position:absolute; left:10; top:100;">


Anyway. In the javascript code you use the name of the layer, and the style..get the psotion and change it to your likings. To let it keep moving you set a time like.
setTimeOut("function-name()", 100)
(the 100 is the time in milli-seconds it will wait to re-do the function)

so, eventually it will look like:

<script language=javascript>
   function MoveItAway()
      var x-now, y-now, x-new, y-new;
      x-now =;
      y-now =;
      x-new = (some math-function-stuff)
      y-new = (some math-function-stuff) = x-new; = y-new;
      tTimer = setTimeOut("MoveItAway()", 100)

Of course you should put in it whatever you need!

Accepted Solution

Bhargava earned 50 total points
ID: 2661887
check if this works.
similar to the one posted by CJ_S

<script language=javascript>
var isIE=false,isNav=false;
if(parseInt(navigator.appVersion) >= 4){
      if(navigator.appName == "Netscape")      {
function set(){
            result = + 15 + document.img.clip.height;
            if(result < screen.height){
         += 15;      
                  document.img.left += 25;
         = 0;
                  document.img.left = 0;
      }else if(isIE){      
                  result = parseInt( + 15 + parseInt(img.offsetHeight);
                  if(result < screen.height){
               = parseInt( + 15;      
               = parseInt( + 25;
               = 0;
               = 0;
         = 0;
<BODY onload="window.setTimeout('set();',1000)">
<div id=img name=img>
<P><IMG align=middle alt=Bear src="images/Bear.gif"></P>


Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Joomla 2.5 shopping cart 7 30
how to debug htl and js pages 8 39
How to check if a session is disconnected in php 9 32
.htaccess css/images no longer loading 4 38
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question