Forum Moderators: open

Message Too Old, No Replies

Ajax Preloader Graphic

big thanks for helping :"¦

         

nhatkhoa

5:00 am on Mar 16, 2006 (gmt 0)

10+ Year Member



I am running some AJAX scripting that sometimes will take a bit to get a response....

I have an animated gif file that I want to appear on the screen (either in a table cell or appearing right in the middle of the screen is fine) as the response is loading, and then have it disappear once it is loaded....

Could anyone help me with this? I have done searches, but only come up with "image preloaders" which I don't think are what I am looking for. Any help is appreciated!

DrDoc

6:11 am on Mar 16, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What I would probably do is have two divs. Make one contain the "loading" graphic, and the other be the placeholder for content. When the page initially loads, the first div is just normal, the other has
display: none
set. Then, as part of filling the content div with content, also toggle the display property for both; setting the former to
none
and the latter to
block
.

nhatkhoa

8:32 am on Mar 16, 2006 (gmt 0)

10+ Year Member



thank to DrDoc
You can give me the code? We should use the method appearchild and removechild? Sorry becoz i used full 4 years for my PHP language, real not care to Javascript, now i felt so grudge >"<
Once again, thank DrDoc.