JavaScript and client side scripting.
Moderator: General Moderators
JellyFish
DevNet Resident
Posts: 1361 Joined: Tue Feb 14, 2006 7:18 pm
Location: San Diego, CA
Post
by JellyFish » Sat Apr 14, 2007 12:47 am
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?
John Cartwright
Site Admin
Posts: 11470 Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:
Post
by John Cartwright » Sat Apr 14, 2007 12:49 am
As far as I'm aware no. Perhaps time the event and use a timeout?
JellyFish
DevNet Resident
Posts: 1361 Joined: Tue Feb 14, 2006 7:18 pm
Location: San Diego, CA
Post
by JellyFish » Sat Apr 14, 2007 1:00 am
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?
John Cartwright
Site Admin
Posts: 11470 Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:
Post
by John Cartwright » Sat Apr 14, 2007 1:07 am
I'm not very knowledgable in javascript, so I'll let the other users tackle this one.
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Sat Apr 14, 2007 7:12 am
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.
Kieran Huggins
DevNet Master
Posts: 3635 Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:
Post
by Kieran Huggins » Sat Apr 14, 2007 1:50 pm
sounds like you have a need for flash - I'm not usually a flash proponent, but when it makes sense it makes sense.
Benjamin
Site Administrator
Posts: 6935 Joined: Sun May 19, 2002 10:24 pm
Post
by Benjamin » Sat Apr 14, 2007 2:00 pm
js could be used to flip through an array of images onload, then once all the images have been displayed, call your function.
JellyFish
DevNet Resident
Posts: 1361 Joined: Tue Feb 14, 2006 7:18 pm
Location: San Diego, CA
Post
by JellyFish » Sat Apr 14, 2007 2:20 pm
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?
Kieran Huggins
DevNet Master
Posts: 3635 Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:
Post
by Kieran Huggins » Sun Apr 15, 2007 4:06 am
Adobe ImageReady will export an animation as a swf - it comes with photoshop.