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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DIV move timing

Status
Not open for further replies.

Akribie

Technical User
Apr 14, 2003
711
GB
Hi,

Been away from JS for a while, but not a novice.

I've got two DIVs the same size running in IE6 - both off screen initially - for a CD-based project using hand-coded HTML/JS with video clips running in Media Player.

One DIV says wait for video to load. Other DIV contains an OBJECT for Windows Media Player.

My routine is structured to move the wait DIV into sight, then load Media Player and wait for it to finish initialising before moving the movie DIV over the top of the wait DIV, and finally moving the wait DIV off screen again.

Looks all very easy in the code. Everything works fine, except that the wait DIV doesn't appear before Media Player has finished initialising and appeared on screen, thus defeating my wish to advise users to wait.

If I put in an alert box, then the wait DIV shows up in the right processing order.

If I remove the wait DIV off screen command, then it is there when I remove the movie.

There is clearly an issue with priorities somewhere - the browser seems to be hijacked by Media Player loading.

I've tried all sort of things including setting up delays and moving bits into separate functions - all to no effect.

So my question is: how can I force a browser screen update to get my wait DIV to show up when I want it to - ie before Media Player takes over?
 
Can you document.body.innerHTML += ''; the 2nd DIV after the page has loaded?

That would prevent MediaPlayer from loading until after the 1st DIV has been displayed.

----------
I'm willing to trade custom scripts for... [see profile]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top