Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 04-14-2003, 08:44 AM   #1 (permalink)
M3GAPL3X
Code Monkey
 
M3GAPL3X's Avatar
 
Join Date: Mar 2003
Location: California
Posts: 57
M3GAPL3X is on a distinguished road
Send a message via AIM to M3GAPL3X
Preloading pages?

Hi,

I have a website called http://www.betacademy.tk and it has a bunch of roll overs on the front page. What I want to do is create a splash page that will preload the images first and then redirect to the main page. A possible preloader graphic would be cool. Does anyone know where I can find such a script?

Would this be easier if I did this in Flash?


Thanks!
__________________
--------------------------
M3GAPL3X@linuxmail.org
M3GAPL3X is offline   Reply With Quote
Old 04-14-2003, 09:06 AM   #2 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,505
sde is on a distinguished road
i found this .. let me know if it works.
PHP Code:
<script>

/*
Preload images script
By JavaScript Kit ([url]http://javascriptkit.com[/url])
Over 400+ free scripts here!
*/

var myimages=new Array()
function 
preloadimages(){
  for (
i=0;i<preloadimages.arguments.length;i++){
    
myimages[i]=new Image()
    
myimages[i].src=preloadimages.arguments[i]
  }
}

//Enter path of images to be preloaded inside parenthesis. Extend list as desired.
preloadimages("http://mydomain.com/firstimage.gif","http://mydomain.com/secondimage.gif","http://mydomain.com/thirdimage.gif")

</script> 
__________________
Mike
sde is offline   Reply With Quote
Old 04-14-2003, 06:27 PM   #3 (permalink)
Epsilon
Regular Contributor
 
Epsilon's Avatar
 
Join Date: Mar 2003
Location: Las Vegas, NV
Posts: 127
Epsilon is on a distinguished road
Why do you need a script for this? A very simple, non-Java way to preload images on your splash page is to include them at the bottom of the splash page with a height an width of 1 pixel (so they won't be seen).
Code:
<img src="images/image1.gif" width="1" height="1">
<img src="images/image2.jpg" width="1" height="1">
This will load them into the browser's cache, making them quickly accessible for other pages in your site. Just make sure that you allow enough time before the re-direct for the images to load over a 56k modem. Figure 4KB per second.
__________________
--Epsilon--
Epsilon is offline   Reply With Quote
Old 04-20-2003, 09:23 AM   #4 (permalink)
M3GAPL3X
Code Monkey
 
M3GAPL3X's Avatar
 
Join Date: Mar 2003
Location: California
Posts: 57
M3GAPL3X is on a distinguished road
Send a message via AIM to M3GAPL3X
Thanks for the tip Epsilon! I will do that on my splash page.
__________________
--------------------------
M3GAPL3X@linuxmail.org
M3GAPL3X is offline   Reply With Quote
Old 04-09-2005, 03:34 AM   #5 (permalink)
purefreak
CAU wh0re
 
purefreak's Avatar
 
Join Date: Apr 2005
Location: South Africa
Posts: 1
purefreak is on a distinguished road
Lightbulb Alternative preloading method using CSS Display

Alternatively you can do it with CSS, using the same concept.
Simply devine a class with display set to none in your <Head> section:

Code:
<style type="text/css">
.hiddenPic {display:none;}
</style>
Then add your images at the bottom of your splash page (before the </body> tag:

Code:
<img src="cauniversity.png" 
  alt="CAU logo" title="CAU logo" 
    height="350" width="350" class="hiddenPic">

<img src="cau-knowledge-bank.png"
  alt="KB logo" title="KB logo"
     height="350" width="350" class="hiddenPic">

<img src="cauniversity.png" 
  alt="cauniversity.org screenshot" title="cauniversity.org screenshot"
     height="350" width="350" class="hiddenPic">
Alternatively you can use this through out your site to load the images of your next page ect.

njoy.
purefreak is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pages still caching. Belisarius Feedback 1 10-24-2004 10:12 AM
Pen-size scanner captures full pages redhead Code Newbie News 0 09-27-2004 06:59 AM
how do u create login pages?? xxm116xx PHP 13 02-24-2003 11:29 AM


All times are GMT -8. The time now is 12:42 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting