SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast Jongo's Avatar
    Join Date
    May 2004
    Location
    Denmark
    Posts
    63
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Rollover animation problem

    I have a problem when displaying a GIF animation on rollover in Mozilla Firebird. My GIF animation is made only to run one time on rollover, however when initializing the rollover with the script...

    <script>
    path_name_1 = new Image(height , width);
    path_name_1.src = "source_name_2.gif";

    function swapimage(name , file) {
    do something...
    }
    </script>

    it seems like Mozilla Firebird is "preloading" the GIF animation, why obvious the animation won't run, but only shows the last frame. I can though get the animation to work in Mozilla Firebird when using...

    onmouseover="this.src='source_name_2.gif'"
    onmouseout="this.src='source_name_1.gif'"
    src="source_name_1.gif"

    although I prefer the first method, since my source would otherwise be rather long. So any help will be much appreciated

  2. #2
    SitePoint Enthusiast Jongo's Avatar
    Join Date
    May 2004
    Location
    Denmark
    Posts
    63
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I solved the "preloading" thing like this...

    path_name_1 = "source_name_1.gif"
    path_name_2 = "source_name_2.gif"

    function swap(thisObject , thisSource) {
    if (document.images) {
    document.images[thisObject].src = eval(thisSource);
    }
    }


Bookmarks

Posting Permissions

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