Forum Moderators: open

Message Too Old, No Replies

status message while file loads

how to add a status message while a large file is loading

         

Windshield

6:32 am on Feb 24, 2002 (gmt 0)



Can anyone share a way to have a status graph or gauge shown while a file such as a gif animation is loading? I have a couple of gif animations on my web sites that can take a minute to load and while they load they look messed up. I've seen some sites where there's an image or graph showing the status of the file loading instead of the partial imqage of the file itself. I'd like to keep it simple and avoid java if possible, seems some of my surfers don't have java capability (found out when they couldn't see simple java roll-overs).

tedster

8:48 am on Feb 24, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Windshield, welcome to the WebmasterWorld Forums.

Here's one approach. It would not show a progress bar -- but most browsers would indicate progress in some way in the status bar. The simplicity tradeoff might be worth losing the extra loading graph, which would require something beyond vanilla HTML as far as I know.

You can use the LOWSRC attribute in your image tag to show a fast loading gif with a text message. That image would then be visible while your larger file loads.

<img src="biganimation.gif" lowsrc="message.gif" width="www" height="hhh">

Windshield

9:32 am on Feb 24, 2002 (gmt 0)



Tedster, tried this several ways after reading your post, can't seem to get it to work. You can view the page and source for it at: [windshieldrepair.com...] . Any ideas what I did wrong?? Thanks

tedster

10:08 am on Feb 24, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Your code is fine -- I wasn't thinking things through.

In Netscape 4 (which renders the lowsrc image just fine, by the way) the minute the first frame of the animation downloads, the browser renders that over top and the LOWSRC image is gone, so you're no better off.

I was surprised to see that none of my version 6 browsers (NN, IE, Opera) rendered the lowsrc image at all. This seems odd to me, because lowsrc is part of DOM1. But I haven't played with lowsrc in quite a while, so please forgive.

Right now I'm a bit stymied. You would need javascript, I think, which you said you want to avoid. Or you might use Java, but even more people would have problems with that than have problems with Javascript (two very different things). Neither case would be simple, in any event.

Flash might me a good answer for you, as long as you offer a non-flash alternative. Showing download progress is a standard feature in Flash.

BlobFisk

12:37 pm on Feb 25, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I am sure I saw the code for something like this on Dynamic Drive [dynamicdrive.com].

Since this is my first post on this Forum, I'd like to say Hello! I'm based in Cork, Ireland and have been designing/developing for the Internet since 1994 when I was a year into my university studies. I look forward to contributing to this Forum.

tedster

5:08 pm on Feb 25, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Blobfisk from Cork, welcome to WebmasterWorld.

Here's a preload images with progress bar [dynamicdrive.com] script from Dynamic Drive - is it what you were remembering?

Windshield

5:31 pm on Feb 25, 2002 (gmt 0)



What happens if the surfer is using a browser that doesn't support js? Will it just load the gif animation or???

IanKelley

6:15 am on Feb 26, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



There's virtually no chance someone will be using a browser that doesn't support JavaScipt... you'd have to go out of your way to find one of those :-) The worst you're going to get is browsers that don't support newer versions of JavaScript and people who have intentionally turned JS off. In this case the script will just get ignored.

In other words, make sure that you comment out the script and that any text (i.e. loading...) is created by the script and not by straight HTML. This way, non java scripters will just see a blank space.

Windshield

7:15 am on Feb 26, 2002 (gmt 0)



Well I'm getting closer....... Thanks for all the help, but now I need just a bit more to finish this project. If you go to [windshieldrepair.com...] , you'll see the "status bar" loads only after the image has been reloaded and only while it is actually loading. I can't figure out how to correct this. Does anyone now how or what to change to get this to work correctly?

BlobFisk

12:50 pm on Feb 26, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Tedster,

That's the one!

tedster

1:41 pm on Feb 26, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Windshield, I'm thinking you might do something completely different to resolve the user-friendliness issue. This current direction looks problematic to me. Two ideas come to mind.

1. This animation can be significantly optimized. At a guess, you could cut 80% or so from the file size and end up with a 60 or 70kb file!

A gif animation does not need to redraw all the pixels for each frame. In this animation, there are many pixels which could be static for the entire length of the animation -- the windshield itself and all the background. It just takes a graphics person who has a handle on how to keep all those extra pixels static frame after frame.

2. You might serve the same purpose (and perhaps serve it better) by having a slide show rather than an animation. The animation can change frames before the visitor has fully taken in what's on the screen. But a slide show puts the frame changes in the user's hands and allows both forward and backward motion as well. In addition, visitors can start using the slideshow while future frames are downloading in the background.

I have been looking at this DHTML code pretty closely, and I'm not convinced it will be at all easy to get it working cross browser and in all situations (resizes, etc.)