www.webdeveloper.com
Results 1 to 2 of 2

Thread: animation

  1. #1
    Join Date
    Nov 2002
    Posts
    1

    Exclamation animation

    how can i made simple animation-one image changing another usinf java script who know please answer me at my e-mail annamaria20017@mail.ru

  2. #2
    Join Date
    Nov 2002
    Location
    Mexico City
    Posts
    52
    This script would change images every 5 seconds:

    <html>
    <img src="x.gif" border="0" name="myimg">

    <script>
    var imgs = new Array();

    //Specify here how much time should be between changes (seconds):

    var time = 5;

    //Put here as much images as you want:

    imgs[0] = "1.gif";
    imgs[1] = "2.gif";
    imgs[2] = "3.gif";
    imgs[3] = "4.gif";
    imgs[4] = "5.gif";
    imgs[5] = "6.gif";
    imgs[6] = "7.gif";
    imgs[7] = "8.gif";

    var i = 0;

    function changeImg() {
    document.images['myimg'].source = imgs[i];
    i == imgs.length ? i=0 : i++ ;
    setTimeout('changeImg()', (time*1000));
    }
    changeImg();
    </script>

    </html>


    I hope this to help.

    Paco.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles