File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes Animated GIF stops with new request Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Animated GIF stops with new request" Watch "Animated GIF stops with new request" New topic
Author

Animated GIF stops with new request

Alaa Nassef
Ranch Hand

Joined: Jan 28, 2008
Posts: 467
Hello All,

I wanted to display an animated GIF to when the user clicks on a specific links which redirects to a very heavy action that takes a lot of processing. The GIF is just a simple image to tell the user that the requested page is loading. Unfortunately, when the link is clicked on, the image is displayed, but not animated.

I know that I can simply create a script that displays a series of images in an infinite loop until the new response is received, but I don't like this solution. Is there any other solution for this?


Visit my blog: http://jnassef.blogspot.com/
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42591
    
  65
All browsers have settings that prevent animations from being played. Maybe yours is set not to animate?


Ping & DNS - my free Android networking tools app
Alaa Nassef
Ranch Hand

Joined: Jan 28, 2008
Posts: 467
Well, this is not the issue. Animated GIFs work fine in my browser, and I actually solved the problem partially. It now works on IE only, and I need to find a solution for FF. What I did to let it work in IE is reloading the source of the image using javascript, after calling the new location of the document. An example code can be found I put the code I used below, which I got from here.

I now need a solution for firefox

Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42591
    
  65
Is the image somewhere publicly accessible so one can take a look at it?
Alaa Nassef
Ranch Hand

Joined: Jan 28, 2008
Posts: 467
Sorry for the late reply. It's a smaller version of this gif. I got it from ajaxload.info. It's called "Indicator lite" there.
[ February 17, 2008: Message edited by: Alaa Nassef ]
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Take a look at this:
http://www.mredkj.com/vbnet/AnimatedGifOnPostback.html

Eric
Alaa Nassef
Ranch Hand

Joined: Jan 28, 2008
Posts: 467
Hello Eric,

Thanks for the website, but it's basically the same trick I did, and that is updating the image source after the action that stops the animation is initiated. This works in IE only, not FF.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61594
    
  67

Most browsers will stop animations upon submission. If you want to keep the display active while a request is being processed you might want to consider making the request using Ajax.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Alaa Nassef
Ranch Hand

Joined: Jan 28, 2008
Posts: 467
Thanks Guys. I just hoped that there would be a workaround for firefox like the one in IE.
Alaa Nassef
Ranch Hand

Joined: Jan 28, 2008
Posts: 467
Thanks Guys. I just hoped that there would be a workaround for firefox like the one in IE.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Animated GIF stops with new request