SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Nov 2000
    Location
    France
    Posts
    81
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have a gif which when 'rolled over' swaps with an animated gif. I want it to sit on the last frame of that animated gif, regardless of whether it is rolled over again or not.
    In other words, I guess I only want the rollover to work once. Possible??? Thanks in advance.

  2. #2
    SitePoint Enthusiast
    Join Date
    Feb 2001
    Location
    D¨n ╔ideann, Alba
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yep ...

    you need to set boolean global variables, ie variables which exist outside of your functions!

    In the head of your doc, or in an external file (this would be better), declare a variable for the rollover state and declare it to be false, e.g isAlreadyOver=false; .

    In the function, have something like ...

    function changeImg(imageName,newImg)
    {
    if (isAlreadyOver=false) {
    do stuff ...
    }
    isAreadyOver = true
    }

    That way the next time the function is called it won't activate.



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
  •