Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Old 11-29-2007, 09:11 PM Preloading images
Average Talker

Posts: 20
Name: Shane
Trades: 0
I am using:
PHP Code:
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin

image1 = new Image();
image1.src = "<?php print $row['url']; ?>";

// End -->
</script>
That is preloading an image that is being displayed. Is there a better way of preloading as it still seems slow? And can I somehow make it so that after the whole page loads it starts loading the next image to speed up surfing? It is a comic book script and the images are a bit big and usually read in order. I would like to be able to make it as fast as possible. Just wondering if you have any ideas...
Demexii is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-30-2007, 01:12 AM Re: Preloading images
Nathand's Avatar
Extreme Talker

Posts: 233
Location: USA
Trades: 0
Quote:
And can I somehow make it so that after the whole page loads it starts loading the next image to speed up surfing?
To my understanding that's what preloading images does. It loads the image before it's used.

This should really be in the javascript forum.

Nathan
Nathand is offline
Reply With Quote
View Public Profile
 
Old 11-30-2007, 07:28 PM Re: Preloading images
Average Talker

Posts: 20
Name: Shane
Trades: 0
Sorry about that. But I want to stop it from loading too early. I don't want it slowing down the current page. Just use idle time to start the next image on the next page. Have it download in the background while they are looking at the current page so the next page will load the image from the cache.
Demexii is offline
Reply With Quote
View Public Profile
 
Old 12-03-2007, 03:29 PM Re: Preloading images
Average Talker

Posts: 20
Name: Levi
Trades: 0
If you put the preloading into a function, maybe you could use the setTimeout() event.
Code:
setTimeout("function name",time in milliseconds to wait to prload);
Levi_ is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Preloading images
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.63253 seconds with 12 queries