Results 1 to 10 of 10
Hybrid View
-
8th Sep 2009, 09:39 PM #1MemberWebsite's:
ibymegaupload.comwith progress bar:
Code:<html> <head> <title>Preload Image Page</title> <script language="JavaScript1.1"> // You may modify the following: var locationAfterPreload = "http://dynamicdrive.com" // URL of the page after preload finishes var lengthOfPreloadBar = 150 // Length of preload bar (in pixels) var heightOfPreloadBar = 15 // Height of preload bar (in pixels) // Put the URLs of images that you want to preload below (as many as you want) var yourImages = new Array("http://yourdomain.com/test1.gif","http://yourdomain.com/test2.gif") // Do not modify anything beyond this point! if (document.images) { var dots = new Array() dots[0] = new Image(1,1) dots[0].src = "black.gif" // default preloadbar color (note: You can substitute it with your image, but it has to be 1x1 size) dots[1] = new Image(1,1) dots[1].src = "blue.gif" // color of bar as preloading progresses (same note as above) var preImages = new Array(),coverage = Math.floor(lengthOfPreloadBar/yourImages.length),currCount = 0 var loaded = new Array(),i,covered,timerID var leftOverWidth = lengthOfPreloadBar%coverage } function loadImages() { for (i = 0; i < yourImages.length; i++) { preImages[i] = new Image() preImages[i].src = yourImages[i] } for (i = 0; i < preImages.length; i++) { loaded[i] = false } checkLoad() } function checkLoad() { if (currCount == preImages.length) { location.replace(locationAfterPreload) return } for (i = 0; i <= preImages.length; i++) { if (loaded[i] == false && preImages[i].complete) { loaded[i] = true eval("document.img" + currCount + ".src=dots[1].src") currCount++ } } timerID = setTimeout("checkLoad()",10) } // end hiding --> </script> </head> <body bgcolor="#FFFFFF"> <center> <font size="4">Please be patient while some images<br> are being preloaded...</font><p> 0% <script language="JavaScript1.1"> <!-- begin hiding // It is recommended that you put a link to the target URL just in case if the visitor wants to skip preloading // for some reason, or his browser doesn't support JavaScript image object. if (document.images) { var preloadBar = '' for (i = 0; i < yourImages.length-1; i++) { preloadBar += '<img src="' + dots[0].src + '" width="' + coverage + '" height="' + heightOfPreloadBar + '" name="img' + i + '" align="absmiddle">' } preloadBar += '<img src="' + dots[0].src + '" width="' + (leftOverWidth+coverage) + '" height="' + heightOfPreloadBar + '" name="img' + (yourImages.length-1) + '" align="absmiddle">' document.write(preloadBar) loadImages() } document.write('<p><small><a href="javascript:window.location=locationAfterPreload">Skip Preloading</a> | <a href="http://dynamicdrive.com/">Script Credits</a></small></p>') // end hiding --> </script> </center> </body> </html>
MUS Reviewed by MUS on . Loading... Is there way to show loading % till the index content is loading ? If not possable in % then loading image? Anyone ? Rating: 5Inside of each man lives a muscle-bound ape who can lift mountains in the weight room, please a dozen women at a time, then sleep like a bear during its hibernation for 8 hours and be ready to do it all again the next day.
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
100tb.com not loading
By CyberHacK in forum General DiscussionReplies: 15Last Post: 19th Feb 2011, 04:45 PM -
Loading Problem
By mrrinmoy in forum Technical Help Desk SupportReplies: 4Last Post: 1st Jan 2011, 04:02 AM -
Keeps Loading
By World Life in forum Technical Help Desk SupportReplies: 10Last Post: 24th Apr 2010, 03:19 PM -
loading
By bmoeller in forum General DiscussionReplies: 8Last Post: 23rd Mar 2010, 05:21 AM -
CSS not loading
By Prince in forum IP.BoardReplies: 1Last Post: 19th Oct 2009, 05:49 PM
themaCreator - create posts from...
Version 3.47 released. Open older version (or...