 |
| Javascript General Javascript discussions. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

January 4th, 2011, 11:02 AM
|
|
Registered User
|
|
Join Date: Jan 2011
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
JScript and annimated gif's
I am building gadgets and need to have something that says loading or similar with some annimation. When I load a gif the annimation happens once and never happens again. Is there a way to make this work every time I require time to load or do something on a gadget?
Rich
|
|

January 4th, 2011, 06:29 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2008
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
|
|
Ummm...whether and how a GIF animates has nothing to do with JavaScript. If your GIF only animates (runs through its cycle of images) once, the GIF is wrong.
|
|

January 4th, 2011, 06:58 PM
|
|
Registered User
|
|
Join Date: Jan 2011
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Quote:
Originally Posted by Old Pedant
Ummm...whether and how a GIF animates has nothing to do with JavaScript. If your GIF only animates (runs through its cycle of images) once, the GIF is wrong.
|
The issue is not the gif, it is a continuous gif and runs fine on a web page. However, within a gadget running JScript as a gadget does, the gif stops after running one time and not one cycle. It runs it's course as normal in the first use. After the first use it no longer functions as an annimated gif. It operates as a static pic. What we are attempting is to provide an indicator that a gadget is working so that the user doesn't keep clicking the run button. Too many clicks just puts the gadget in a non-responding mode and ruins the page effect.
|
|

January 4th, 2011, 07:10 PM
|
|
Registered User
|
|
Join Date: Jan 2011
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Quote:
Originally Posted by Old Pedant
Ummm...whether and how a GIF animates has nothing to do with JavaScript. If your GIF only animates (runs through its cycle of images) once, the GIF is wrong.
|
The issue is not the gif, it is a continuous gif and runs fine on a web page. However, within a gadget running JScript as a gadget does, the gif stops after running one time and not one cycle. It runs it's course as normal in the first use. After the first use it no longer functions as an annimated gif. It operates as a static pic. What we are attempting is to provide an indicator that a gadget is working so that the user doesn't keep clicking the run button. Too many clicks just puts the gadget in a non-responding mode and ruins the page effect.
|
|

January 4th, 2011, 09:06 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2008
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
|
|
Oh, you mean the animated gif is not one that animates forever!
So the problem is that when you re-show it, the image isn't really refreshed and the user just sees the image as it was at the end of its cycle.
So what you need is a way to FORCE a reload of the image, yes?
*IF* you control the web server, there's a fairly simple way to do this: Fool the browsers. Append a random string to the image url. That is:
ourimage.gif?37119182
On a Linux machine, this is easy to accomplish, by just filtering out the string. It's a bit trickier on Windows, but can be done.
|
|

January 4th, 2011, 09:08 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2008
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
|
|
Of course, the easy alternative is to find a GIF that *does* animate forever. Keeps cycling over and over. So it won't matter when the image is viewed.
|
|

January 5th, 2011, 04:59 PM
|
|
Registered User
|
|
Join Date: Jan 2011
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Gif annimation
The gif we have is continuous. That is not the issue. The gadget itself somehow shuts the annimation offafter a time. In a standard web application this all works fine. However, in a gadget format it does not. Gadgets do not work like web browsers even though they seem to be browser based.
|
Similar Threads
|
| Thread |
Thread Starter |
Forum |
Replies |
Last Post |
| ScreenSize in JScript |
Jitender |
BOOK: Professional XMPP Programming with JavaScript and jQuery |
1 |
December 5th, 2010 08:01 PM |
| JScript |
DumAss |
HTML Code Clinic |
1 |
August 25th, 2004 02:46 AM |
| PLEASE HELP! ACTIVEX in JScript |
stalker |
Javascript |
2 |
August 15th, 2003 05:04 PM |
| JScript |
Des67 |
Javascript |
1 |
July 28th, 2003 05:05 AM |
|
 |