Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Bug on 1st loading, OK on re-load 1

Status
Not open for further replies.

maharg

Technical User
Mar 21, 2002
184
Hi Folks

I have an example of a javascript banner at
The banner seems to stall before reaching the end, when you first load.

If you re-load, it runs correctly.

Any ideas what the problem is?

Thanks,

Graham
 
Worked fine in Safari when I tested it. I did noice you had two onloads being set (to the same thing)... you don't need two... but that's not going to change your observed behaviour.

Try testing it in a few different browsers (Firefox and IE at the very least if you are a Windows user). It could be something related to a specific browser only.

Cheers,
Jeff

[tt]Jeff's Page @ Code Couch
[/tt]

What is Javascript? FAQ216-6094
 
Hi Jeff,

Thanks for giving it a try, and thanks for spotting the onload dupe - removed.

Seems to happen consistently in firefox and windows, both latest releases.

Tried it on 3 machines myself and had the effect pointed out to me by another user.
 
It worked fine for me on both ie and firefox. I sat an watched it a few times too couldnt reproduce the stalling.
 
It part runs, but resets before the message is complete.

Then, if you re-load it, it runs the whole message correctly.

There's definitely a bug there ....
 
I would guess that your ticker is starting before it loads the entire GIF image, but if you refresh the page, it has time to load the image. Faster Internet connections won't have this problem, where slower ones will start the ticker before the image is completely loaded. The load on the server could affect the speed with which the image is delivered, too. A fraction of a second couild make this kind of difference.

The ticker image isn't loaded until the first call to the ticker, where normally images are loaded as part of the page and would be available at a call to the window.onload event handler. Try preloading the image and see how that works.

Lee
 
I would just preload the image in the rest of the JS at the top of the page. Then it would be ready to be displayed when the onload event handler triggers. Right now the div and image aren't written to the page until AFTER the page onload event handler fires.

Lee
 
Hi guys, that seems to have fixed it!

Many thanks indeed.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top