SitePoint Sponsor |
|
User Tag List
Results 1 to 2 of 2
-
Apr 4, 2001, 02:32 #1
- 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.
-
Apr 4, 2001, 02:52 #2
- 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