Welcome to MobyThreads.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in
All support for the MobyThreads Threaded phpBB MOD can now be found on welsolutions at this forum

How to Delay an Image/HTML loading?

 
   Web Hosting and Web Master Forums (Home) -> Webmaster RSS
Next:  Checkboxes & Greyed out Drop-Down Lists  
Author Message
saveworldfroma

External


Since: Aug 20, 2004
Posts: 38



(Msg. 1) Posted: Mon Aug 16, 2004 10:27 am
Post subject: How to Delay an Image/HTML loading?
Archived from groups: alt>www>webmaster, others (more info?)

I need to delay something either an image or a table from loading for 2-5
seconds. So far I have not find a good method.

I need the rest of the page, even the codes after the delayed image, to be
displayed in real time.

 >> Stay informed about: How to Delay an Image/HTML loading? 
Back to top
Login to vote
nospam77

External


Since: Aug 16, 2004
Posts: 1



(Msg. 2) Posted: Mon Aug 16, 2004 11:48 am
Post subject: Re: How to Delay an Image/HTML loading? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

It depends on what you want to do.

The first idea could be, give an id to the image and then
function foo(){
document.getElementById("imageId").src="mygif.gif";
}
<body onLoad="foo()">

this changes the src of the image only after the page has loaded. But maybe
you mean you don't even eant the image tag till then... If so:

you can create a layer where the image is hosted and create an image node
within it after the page has loaded

DO give an id to the layer meant to host the image, say:

<div id="layer1"></div>

Now:

function foo(){
var appendToId = document.getElementById("layer1");
var image = document.createElement("IMG"); //UPPERCASE!
appendToId.appendChild(image);
image.width=100;//custom
image.height=100;//custom
image.src="mygif.gif";//custom
}

then <body onLoad="foo()">

I hope I didn't insert any typo or silly error, writing on the run you see,
but they seem valid ideas

ciao
Alberto
<a style='text-decoration: underline;' href="http://www.unitedscripters.com/" target="_blank">http://www.unitedscripters.com/</a>





"http://links.i6networks.com" <SaveWorldFromAids DeleteThis @alexa.com> ha scritto nel
messaggio news:KlZTc.2000$FZs1.294@news04.bloor.is.net.cable.rogers.com...
 > I need to delay something either an image or a table from loading for 2-5
 > seconds. So far I have not find a good method.
 >
 > I need the rest of the page, even the codes after the delayed image, to be
 > displayed in real time.
 >
 >
 ><!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: How to Delay an Image/HTML loading? 
Back to top
Login to vote
spam19

External


Since: May 08, 2004
Posts: 952



(Msg. 3) Posted: Mon Aug 16, 2004 11:52 am
Post subject: Re: How to Delay an Image/HTML loading? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Mon, 16 Aug 2004 07:27:38 GMT, <a style='text-decoration: underline;' href="http://links.i6networks.com" target="_blank">http://links.i6networks.com</a>
<SaveWorldFromAids.DeleteThis@alexa.com> wrote:

 > I need to delay something either an image or a table from loading for 2-5
 > seconds. So far I have not find a good method.
 >
 > I need the rest of the page, even the codes after the delayed image, to
 > be displayed in real time.

Easy[1], with PHP's sleep() command. Want to delay a table? Write a
PHP-parsed javascript file with document.write()s writing the table, then
put a sleep(5); command in the middle of it.

Same thing with images. Write a PHP image serving script, then put a
sleep(5); command before sending the output to the browser.

Grey

[1] Assuming you have a basic grasp of PHP. I'm not writing the script
for you, sorry.

--
The technical axiom that nothing is impossible sinisterly implies the
pitfall corollory that nothing is ridiculous.
- <a style='text-decoration: underline;' href="http://www.greywyvern.com" target="_blank">http://www.greywyvern.com</a> - Orca Knowledgebase: Completely CSS styleable
Knowledgebase/FAQ system<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: How to Delay an Image/HTML loading? 
Back to top
Login to vote
saveworldfroma

External


Since: Aug 20, 2004
Posts: 38



(Msg. 4) Posted: Mon Aug 16, 2004 1:52 pm
Post subject: Re: How to Delay an Image/HTML loading? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Are you sure that onload is called after body finished loading? I thought
onload is called when it first get loaded.

 > It depends on what you want to do.
 >
 > The first idea could be, give an id to the image and then
 > function foo(){
 > document.getElementById("imageId").src="mygif.gif";
 > }
 > <body onLoad="foo()">
 >
 > this changes the src of the image only after the page has loaded. But
maybe
 > you mean you don't even eant the image tag till then... If so:
 >
 > you can create a layer where the image is hosted and create an image node
 > within it after the page has loaded
 >
 > DO give an id to the layer meant to host the image, say:
 >
 > <div id="layer1"></div>
 >
 > Now:
 >
 > function foo(){
 > var appendToId = document.getElementById("layer1");
 > var image = document.createElement("IMG"); //UPPERCASE!
 > appendToId.appendChild(image);
 > image.width=100;//custom
 > image.height=100;//custom
 > image.src="mygif.gif";//custom
 > }
 >
 > then <body onLoad="foo()">
 >
 > I hope I didn't insert any typo or silly error, writing on the run you
see,
 > but they seem valid ideas
 >
 > ciao
 > Alberto
<font color=purple> > <a style='text-decoration: underline;' href="http://www.unitedscripters.com/</font" target="_blank">http://www.unitedscripters.com/</font</a>>
 >
 ><!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: How to Delay an Image/HTML loading? 
Back to top
Login to vote
user570

External


Since: Aug 16, 2004
Posts: 8



(Msg. 5) Posted: Mon Aug 16, 2004 2:03 pm
Post subject: Re: How to Delay an Image/HTML loading? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

[Follow-ups set to clj]

On Mon, 16 Aug 2004 10:52:20 GMT, <a style='text-decoration: underline;' href="http://links.i6networks.com" target="_blank">http://links.i6networks.com</a>
<SaveWorldFromAids.DeleteThis@alexa.com> wrote:

 > Are you sure that onload is called after body finished loading? I thought
 > onload is called when it first get loaded.

From the DOM 2 Events Specification:

load
The load event occurs when the DOM implementation finishes loading
all content within a document, all frames within a FRAMESET, or an
OBJECT element.

[snipped top-post]

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: How to Delay an Image/HTML loading? 
Back to top
Login to vote
blackhole

External


Since: Apr 13, 2004
Posts: 235



(Msg. 6) Posted: Tue Aug 17, 2004 1:57 am
Post subject: Re: How to Delay an Image/HTML loading? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

<a style='text-decoration: underline;' href="http://links.i6networks.com" target="_blank">http://links.i6networks.com</a> wrote:

 > Are you sure that onload is called after body finished loading? I thought
 > onload is called when it first get loaded.

onload is only supposed to be triggered after everything in the page has
loaded including all images, css, js files etc.

--
Chris Hope - The Electric Toolbox - <a style='text-decoration: underline;' href="http://www.electrictoolbox.com/" target="_blank">http://www.electrictoolbox.com/</a><!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: How to Delay an Image/HTML loading? 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Image Loading Progress Bar? - Hi, I am looking for a Javascript that can create a image-loading progress bar while several images are being cached. I liked the script posted at: http://scriptasylum.com/miscpage.html However, this script doesn't work very well with Netscape 7 or...

Loading time - Howdy guys and gals. Please would someone take a look at my site http://www.cajunlifeandtimes.com/index.htm and let me know if it loads in a "reasonable" time. I only have access to broadband, therefore it comes up instantly however I would lik...

Display "loading" page - I should like to display a static HTML page while a Perl script executes, and then display the Perl output - Eg: someone selects a search, and while the server thinks about it display a "please wait" message. Any ideas how? I have finally give...

Forced loading of scripts - Hi. I don't know if this is the right place to give this question, but the problem is: I wan't to make html code or script that is used in every subdirectory on my site. As example Geocities is using it on their homepages, but as ads... Anyone who know...

Playback short audio file on loading - I have a page on which, when it loads, I wish a short (and quickly downloadable) audio file to playback automatically. I know of the "onload" option, but this is only good in IE. Can anyone point me towards an equally elegant method to play an ...
   Web Hosting and Web Master Forums (Home) -> Webmaster All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]