[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

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

Posted on 2007-11-28
3
Medium Priority
?
431 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 14

Accepted Solution

by:
B_Dorsey earned 2000 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…
Suggested Courses

656 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