www.webdeveloper.com
Results 1 to 3 of 3

Thread: [RESOLVED] Javascript rotate and fade - can't get fade to work

  1. #1
    Join Date
    Dec 2005
    Posts
    32

    resolved [RESOLVED] Javascript rotate and fade - can't get fade to work

    Hi,

    I have a javascript code that rotates a bunch of images, and I am trying to get it to fade in between images, but I can not get the fade to work. It just ignores my fade function, please help. Here is my code:

    Code:
     var imgs = new Array(); 
     var imgcnt = 0; 
     var thisimg = 0;
    imgs[imgcnt++] = 'images/sternd1.gif';
    imgs[imgcnt++] = 'images/sternd2.gif';
    imgs[imgcnt++] = 'images/sternd3.gif';
    var imgid = document.getElementById('rotimg');
    function fadeOut()
    { 
    imgid.style="filter:alpha(opacity=25);-moz-opacity:.25;opacity:.25;";
    }
    function rotate() {
    if (document.images) {
    if (thisimg >= imgcnt) thisimg = 0;
    document.rotimg.src = imgs[thisimg];
    thisimg++;
    setTimeout("rotate();fadeOut();",10000);
    }
    }
    setTimeout("rotate();",0);

    Here is a link to the page with the working rotation but not fade http://www.upc.org/stewardshiprot.aspx?id=44


    Thanks in advance for you help.

    Kevin

  2. #2
    Join Date
    May 2004
    Location
    FL
    Posts
    3,447
    The fade seems to be working for me on FF, although a bit jumpy.
    Lee

    ""Men occasionally stumble over the truth, but most of them pick themselves up and hurry off as if nothing ever happened."" -- Sir Winston Churchill

  3. #3
    Join Date
    Dec 2005
    Posts
    32
    I was able to get it working using a script I found on the internet. Thanks for your help.

    Kevin

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