Solved

script for loading bar/graphic on slow page (persits images loading)

Posted on 2007-11-28
3
412 Views
Last Modified: 2012-08-13
Hi

I am developing an online store that on the product list page loads up using persits small thumbnails of images. It's fast in some browsers and sluggish in oteres.

I'd like to have a small loading graphic which will loop until all the images are loaded. Is this possible?

Pages are asp vb

Thanks

Dave
0
Comment
Question by:swordfishsoup
3 Comments
 
LVL 14

Accepted Solution

by:
B_Dorsey earned 500 total points
ID: 20367134
basically  I would just flaot a image at the center of the page with some loading bars, then use the body onload event to remove it.
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 20368559
Check this method:
<img src="first.gif" onLoad="this.onload=null;this.src='product1.gif';" >

<img src="first.gif" onLoad="this.onload=null;this.src='product2.gif';" >

<img src="first.gif" onLoad="this.onload=null;this.src='product3.gif';" >

Open in new window

0
 
LVL 8

Expert Comment

by:deadite
ID: 20372048
Try preloading your images like so:
I don't know if this is ASP or not, but here is a javascript.  Google "Preload Images" and you'll find a ton of methods to do this.  You can basically put that in an onload and display an image there...

    <SCRIPT language="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<=3; i++)
         preload_image_object.src = image_url[i];
    }

    //-->
    </SCRIPT>  
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This script will sweep a range of IP addresses (class c only, 255.255.255.0) and report to a log the version of office installed. What it does: 1.)      Creates log file in the directory the script is run from (if it doesn't already exist) 2.)      Sweep…
This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now