Solved

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

Posted on 2007-11-28
3
417 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Over the years I have built up my own little library of code snippets that I refer to when programming or writing a script.  Many of these have come from the web or adaptations from snippets I find on the Web.  Periodically I add to them when I come…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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…

861 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