Moderators: Derry, Goldie, Harpo
Go
New
Find
Notify
Tools
Reply
  
-star Rating Rate It!  Login/Join 
Honorary Mechanic
Picture of FenxLegacy
Posted
I have a question for anyone? Is it better for load time to have a photoslide show, or having the pictures displayed all the time on the page? Or is it the same?
What I'm trying to accomplish is having a faster load time,and a slide show of sorts. Suggestions? Thanks in advance.
 
Posts: 106 | Registered: September 09, 2007Reply With QuoteEdit or Delete MessageReport This Post
Guru 'Geezer' Mechanic
Picture of larryd
Posted Hide Post
If you are using a DHTML/Javascript slideshow, you may be able to speed things up by preloading the images. This is done by executing a small script in the head section to load the images in the cache so they are already available for the slideshow when the page is displayed. For example:
<script type='text/javascript'>
<!--
if (document.images) {
  preload_image_object = new Image();
  // set image url
  image_url = new Array();
  image_url[0] = "http://mydomain.com/image0.gif";
  image_url[1] = "http://mydomain.com/image1.gif";
  image_url[2] = "http://mydomain.com/image2.gif";
  image_url[3] = "http://mydomain.com/image3.gif";

  var i = 0;
  for(i=0; i<image_url.length; i++) preload_image_object.src = image_url[i];
}
//-->
</script>  
Change the http://mydomain.com/image0.gif references to your actual image URL, or if it is a SS image reference, to ./image/my-image.jpg
 
Posts: 5067 | Registered: December 03, 2006Reply With QuoteEdit or Delete MessageReport This Post
  Powered by Eve Community  
 


™ & © 1998 - 2008, Virtual Mechanics Inc. All rights reserved.