Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-11-2006, 09:36 PM   PM User | #1
sybil6
Regular Coder

 
Join Date: Jul 2006
Posts: 399
Thanks: 33
Thanked 7 Times in 7 Posts
sybil6 can only hope to improve
loading progress bar

how is it possible to do a loading progress bar,the msot simple way, i read taht you can make this in a very simple way using the image class(with the image array) or also using the image array so all your pics would load when the site starts but i think the first solution is easier(loading bar), i have a very simple site that uses html and css and if any of you knew about this simple java script loading bar?
sybil6 is offline   Reply With Quote
Old 12-11-2006, 09:49 PM   PM User | #2
feras_wilson
Regular Coder

 
feras_wilson's Avatar
 
Join Date: Jul 2005
Location: Sweden
Posts: 129
Thanks: 1
Thanked 0 Times in 0 Posts
feras_wilson is an unknown quantity at this point
Smile Here is your solution

Hi!
I found the script you wanted in this website:
http://www.dynamicdrive.com
http://www.dynamicdrive.com/dynamici...mlprogress.htm

HEHE!
__________________
Exp:
PHP
.NET
feras_wilson is offline   Reply With Quote
Old 12-12-2006, 01:17 AM   PM User | #3
kwhubby
Regular Coder

 
Join Date: Nov 2002
Location: Carmel California
Posts: 471
Thanks: 0
Thanked 1 Time in 1 Post
kwhubby is an unknown quantity at this point
That dynamicdrive loading bar is time based, meaning it has nothing to do with if everything is loaded. I built a loading bar for images based on if they all loaded using document.images[].complete I found that each picture had to be loaded one by one into a hidden div to function properly.
From an old thread, I dug up this.
http://www.javascriptfr.com/code.aspx?ID=15834

If you want, I could build you a easy snippet of code, but I might not be able to get to it for a while. The code for a loading bar I am using has ugly code so I wouldn't give that to you right now.
__________________
Kris Hubby
kwhubby site
kwhubby is offline   Reply With Quote
Old 12-12-2006, 07:10 AM   PM User | #4
sybil6
Regular Coder

 
Join Date: Jul 2006
Posts: 399
Thanks: 33
Thanked 7 Times in 7 Posts
sybil6 can only hope to improve
thank you and what would be the code for loading all the images as the site starts?, i know that is pretty simple to do this with the image array class.
sybil6 is offline   Reply With Quote
Old 12-12-2006, 07:59 AM   PM User | #5
_Aerospace_Eng_
Supreme Master coder!


 
_Aerospace_Eng_'s Avatar
 
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,293
Thanks: 2
Thanked 1,044 Times in 1,020 Posts
_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light
Quote:
Originally Posted by kwhubby View Post
That dynamicdrive loading bar is time based, meaning it has nothing to do with if everything is loaded. I built a loading bar for images based on if they all loaded using document.images[].complete I found that each picture had to be loaded one by one into a hidden div to function properly.
From an old thread, I dug up this.
http://www.javascriptfr.com/code.aspx?ID=15834

If you want, I could build you a easy snippet of code, but I might not be able to get to it for a while. The code for a loading bar I am using has ugly code so I wouldn't give that to you right now.
Its not time based. Both progress bar scripts found on dynamic drive use documnt.images[].oncomplete.

This is in the JS for the second version
Code:
function checkload(index){
(images[index].complete)? dispbars() : setTimeout('checkload('+index+')', 100);
}
Version 1 of that script uses this
Code:
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) 
}
__________________
||||If you are getting paid to do a job, don't ask for help on it!||||
_Aerospace_Eng_ is offline   Reply With Quote
Old 12-12-2006, 10:13 PM   PM User | #6
sybil6
Regular Coder

 
Join Date: Jul 2006
Posts: 399
Thanks: 33
Thanked 7 Times in 7 Posts
sybil6 can only hope to improve
thank you, the function check load works quite good, i just put it in the html files that got heavy images.
sybil6 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:41 AM.


Advertisement
Log in to turn off these ads.