Looking for animated gif event...

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
JellyFish
DevNet Resident
Posts: 1361
Joined: Tue Feb 14, 2006 7:18 pm
Location: San Diego, CA

Looking for animated gif event...

Post by JellyFish »

I'm looking for a way to trigger a function when a gif has finnished it's animation, with javascript. Is this possible in anyway?
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

As far as I'm aware no. Perhaps time the event and use a timeout?
User avatar
JellyFish
DevNet Resident
Posts: 1361
Joined: Tue Feb 14, 2006 7:18 pm
Location: San Diego, CA

Post by JellyFish »

I could use a timeout or animate the gif with javascript. Animating with Javascript will give me full control over the animation but I don't know how advisable this would be? Would the animation preform less as good with javascript?
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

I'm not very knowledgable in javascript, so I'll let the other users tackle this one.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Provided you aren't creating multiple objects on the fly, Javascript will handle animation fairly fine unless your frame rate is too high. You will have to make sure all the images are loaded before starting or it will potentially look very odd.
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post by Kieran Huggins »

sounds like you have a need for flash - I'm not usually a flash proponent, but when it makes sense it makes sense.
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Post by Benjamin »

js could be used to flip through an array of images onload, then once all the images have been displayed, call your function.
User avatar
JellyFish
DevNet Resident
Posts: 1361
Joined: Tue Feb 14, 2006 7:18 pm
Location: San Diego, CA

Post by JellyFish »

astions wrote:js could be used to flip through an array of images onload, then once all the images have been displayed, call your function.
That's what I was thinkin'.

Flash would be great, but I don't have any flash design software. Is there a way to write flash by hand?
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post by Kieran Huggins »

Adobe ImageReady will export an animation as a swf - it comes with photoshop.
Post Reply