Log in

View Full Version : Play/ stop Gif



Bornfree
09-27-2007, 03:07 AM
Is there anyway to HAve a gif file in stop mode when it's loaded and than a button to play it and pause it?

Jack
09-27-2007, 03:46 AM
Isn't that what we call a flash file?

:cool:

Bornfree
09-27-2007, 03:52 AM
hi Jack,

I have two animated files. one is a .swf and the other is a .gif
I have the controls for the .swf file but i want to know how to control the .gif file?

I guess the user needs flash player to view the .swf file but a gif file can be viewed in the browser.
Please correct me if i'm wrong!

insanemonkey
09-27-2007, 03:58 AM
Try this... but you are going to have to make a stop gif and a start gif... kinda wierd but... try this out.. maybe it might work...



The image you want to change -
<img src="still.gif" id="gif1" alt="image" />

The start image -
<a href="#" onclick="document.getElementById('gif1').src='moving.gif'"><img src="start.gif" alt="play animation" /></a>

The stop image -
<a href="#" onclick="document.getElementById('gif1').src='still.gif'"><img src="stop.gif" alt="stop animation" /></a>

Bornfree
09-27-2007, 04:08 AM
what is still .gif

Bornfree
09-27-2007, 04:13 AM
Hey it works! Thanks a lot insanemonkey!
Very much apperciated

Bornfree
09-27-2007, 04:19 AM
Just one last question. When I click on the play and stop buttons, it takes me to the top of the page! what can do to stay on the same section?

Thanks a lot. you guys are just too much

insanemonkey
09-27-2007, 04:19 AM
YUP no problem-o hehehe your welcome

tech_support
09-27-2007, 09:09 AM
Just one last question. When I click on the play and stop buttons, it takes me to the top of the page! what can do to stay on the same section?
Changes are highlighted.



The image you want to change -
<img src="still.gif" id="gif1" alt="image" />

The start image -
<a href="#" onclick="document.getElementById('gif1').src='moving.gif'; return false"><img src="start.gif" alt="play animation" /></a>

The stop image -
<a href="#" onclick="document.getElementById('gif1').src='still.gif'; return false"><img src="stop.gif" alt="stop animation" /></a>

Bornfree
09-27-2007, 08:54 PM
Thanks a lot. You guys just rock man!!!!!:cool: