Solved

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

Posted on 2007-11-28
3
410 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
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…

744 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

17 Experts available now in Live!

Get 1:1 Help Now