SitePoint Sponsor |
|
User Tag List
Results 1 to 3 of 3
Thread: --- Preloading script ??? --
-
May 19, 2008, 01:05 #1
- Join Date
- May 2002
- Location
- Cape Town
- Posts
- 458
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
--- Preloading script ??? --
Hi all,
Ive created a site here:
http://www.plan-myafrica.com/see.htm
If you click on ths thumbnails, a bigger picture pops up..
problem is, the bigger pictures sometimes take ages to load up..
Can anyone suggest a preloading script i can put in here for the bigger pictures, so the pictures load while the page loads?? or anything similar?
Thanks!
Dee"have the courage to follow your heart and intuition. They somehow already know what you truly want to become"
-
May 19, 2008, 02:05 #2
- Join Date
- Sep 2006
- Posts
- 731
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
That script has a bizarre way of doing things...
Blanket pre-loading will increase your bandwidth usage and on slow connections may not always appear to improve performance. You don't actually need a script to pre-load images - you can have normal <img> tags in a hidden div or set their width and height to 0.
Code:function PreLoader() { this.holder=[]; for(var i=0, len=arguments.length; i<len; i++) { this.holder[i]=new Image(); this.holder[i].src=arguments[i]; } } Usage: new PreLoader('your.jpg', 'images.jpg', 'here.jpg');
Tab-indentation is a crime against humanity.
-
May 19, 2008, 02:07 #3
- Join Date
- Jun 2007
- Location
- Bristol, England
- Posts
- 74
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Instead of a preloading script which will (if the many images are as you say "big") drain bandwidth for people on slower connections, I would suggest something like lightbox which will show a loading bar.
Bookmarks