Webmaster Forum Logo Part 1 Webmaster Forum Logo Part 2
Webmaster Forum Logo Part 3
     
 
  :: Anmeldung

Benutzername:

Registrierung...

Passwort:

Passwort vergessen?

angemeldet bleiben


  
  :: Umfrage
Welche sozialen Netzwerke benutzt du regelmäßig?

 Facebook
 Webmaster - WebspaceWebmaster - WebspaceWebmaster - Webspace 73%
 keines
 Webmaster - WebspaceWebmaster - WebspaceWebmaster - Webspace 22%
 Google+
 Webmaster - WebspaceWebmaster - WebspaceWebmaster - Webspace 19%
 Twitter
 Webmaster - WebspaceWebmaster - WebspaceWebmaster - Webspace 11%
 Xing
 Webmaster - WebspaceWebmaster - WebspaceWebmaster - Webspace 6%
 schülerVZ
 Webmaster - WebspaceWebmaster - WebspaceWebmaster - Webspace 5%
 meinVZ
 Webmaster - WebspaceWebmaster - WebspaceWebmaster - Webspace 4%
 studiVZ
 Webmaster - WebspaceWebmaster - WebspaceWebmaster - Webspace 4%
 MySpace
 Webmaster - WebspaceWebmaster - WebspaceWebmaster - Webspace 2%
 LinkedIn
 Webmaster - WebspaceWebmaster - WebspaceWebmaster - Webspace 2%

 ges. 392 Stimmen
 
  :: Buttons

Valid XHTML 1.0 Transitional

Shin Ryu

Routinier

Dabei seit: 23.03.2003

Beiträge: 467

 

1 Zum Seitenanfang

Donnerstag, 26. August 2004, 13:22

Problem mit Preloadscript

Ich habe ein Problem mit folgendem Script. Irgendwie bleibt es beim 19 Bild stehen und leider weiss ich nicht, warum das so ist.

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
<html>
<head>
<title>You will be redirected in a few moments</title>
<script language="JavaScript1.2">
<!-- begin hiding

startingColor = new Array() // <-- Do not modify!
endingColor = new Array() // <-- Do not modify!

// YOU MAY MODIFY THE FOLLOWING:
var yourImages = new Array("Bilder/bg.jpeg", "Bilder/contentbg.gif", "Bilder/contentbottom.gif", "Bilder/contentside1.gif", "Bilder/contentside1-15.gif", "Bilder/contentside2.gif", "Bilder/contenttop.gif", "Bilder/drag.gif", "Bilder/drag_up.gif", "Bilder/drag_down.gif", "Bilder/header_2.gif", "Bilder/header_1.gif", "Bilder/ident.gif", "Bilder/navibottom.gif", "Bilder/naviside.gif", "Bilder/updat.gif", "Bilder/works.gif", "content/Bilder/updates.gif", "content/Bilder/works.gif", "content/Bilder/ident.gif") // Fill this array with the images you wish to preload
var locationAfterPreload = "Index.html" // The script will redirect here when the preloading finishes *successfully*
var preloadbarWidth = 250 // The length of the preload bar. Should be greater than total amount of images you want to preload!
var preloadbarHeight = 2 // The height of the gradient/preload bar
var backgroundOfGradient = "#BDAB82" // Default color while the preload bar is "filling up"

// Color the preloadbar is starting with - enter 1st, 3rd and 5th numbers/letters of color code
startingColor[0] = "2" 
startingColor[1] = "2"
startingColor[2] = "1"

// Color the prelofdbar is going to end up with - enter the 1st, 3rd and 5th numbers/letters of color code
endingColor[0] = "2"
endingColor[1] = "2"
endingColor[2] = "1"

// FOR TROUBLESHOOTING:
var gap = 7 // PLAY AROUND WITH THIS SETTING IF YOU GET A JAVASCRIPT ERROR!!! 2 is the minumum value!!!


// DO NOT MODIFY ANYTHING BEYOND THIS POINT!!!

if (!document.all) location.replace(locationAfterPreload)
var a = 10, b = 11, c = 12, d = 13, e = 14, f=15, i, j, ones = new Array(), sixteens = new Array(), diff = new Array();
var convert = new Array("0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"), imgLen = yourImages.length;
var loaded = new Array(), preImages = new Array(), currCount = 0, pending = 0, h = 0, hilite = new Array(), cover = new Array();
var num = Math.floor(preloadbarWidth/gap);
for (i = 0; i < 3; i++) {
	startingColor[i] = startingColor[i].toLowerCase();
	endingColor[i] = endingColor[i].toLowerCase();
	startingColor[i] = eval(startingColor[i]);
	endingColor[i] = eval(endingColor[i]);
	diff[i] = (endingColor[i]-startingColor[i])/num;
	ones[i] = Math.floor(diff[i]);
	sixteens[i] = Math.round((diff[i] - ones[i])*15);
}
endingColor[0] = 0;
endingColor[1] = 0;
endingColor[2] = 0;
i = 0, j = 0;
while (i <= num) {
	hilite[i] = "#";
	while (j < 3) {
		hilite[i] += convert[startingColor[j]];
		hilite[i] += convert[endingColor[j]];
		startingColor[j] += ones[j];
		endingColor[j] += sixteens[j];
		if (endingColor[j] > 15) {
			endingColor[j] -= 15;
			startingColor[j]++;
		}
		j++;
	}
	j = 0;
	i++;
}
function loadImages() {
	for (i = 0; i < imgLen; i++) {
		preImages[i] = new Image();
		preImages[i].src = yourImages[i];
		loaded[i] = 0;
		cover[i] = Math.floor(num/imgLen)*(i+1)
	}
	cover[cover.length-1] += num%imgLen
	checkLoad();
}
function checkLoad() {
	if (pending) { changeto(); return }
	if (currCount == imgLen) { location.replace(locationAfterPreload); return }
	for (i = 0; i < imgLen; i++) {
		if (!loaded[i] && preImages[i].complete) {
			loaded[i] = 1; pending++; currCount++;
			checkLoad();
			return;
		}
	}
	setTimeout("checkLoad()",10);
}
function changeto() {
	if (h+1 > cover[currCount-1]) {
		var percent = Math.round(100/imgLen)*currCount;
		if (percent > 100) while (percent != 100) percent--;
		if (currCount == imgLen && percent < 100) percent = 100;
		defaultStatus = "Loaded " + currCount + " out of " + imgLen + " images [" + percent + "%].";
		pending--;
		checkLoad();
		return;
	}
	eval("document.all.cell" + (h+1) + ".style.backgroundColor = hilite[h]");;
	h++;
	setTimeout("changeto()",1);
}
defaultStatus = "Loaded 0 out of " + imgLen + " images [0%]."
// end hiding -->
</script>
<style type="text/css">
BODY {
	font-family: Tahoma;
	text-decoration:none;
	font-size:10px;
	color:#27241D;
}
A { text-decoration: none; };
A:link { color: #78808A; };
A:visited { color: #78808A; };
A:hover { color: #595F66; };
	</style>
</head>
<script language="JavaScript1.2">
<!-- beging hiding
document.write('<table border="0" height="100%" width="100%"><tr><td height="100% width="100%" align="center" valign="middle">');
document.write('<center valign=middle><font face="tahoma" style=\"font-size: 10px\"><center></center></font><br>');
document.write('<table  border="0" cellpadding="0" cellspacing="0" width="' + preloadbarWidth + '"><tr height="' + preloadbarHeight + '" bgcolor="' + backgroundOfGradient + '">');
for (i = 0; i < num; i++) {
	document.write('<td width="' + gap + '" id="cell' + (i+1) + '"></td>');
}
document.write('</tr></table>');
loadImages();
// end hiding -->
</script>
</center>
</head>

<body scroll=no background="Bilder/bg.jpg">

</font>


</body>

</html>


Dankeschön für die Hilfe
str8fwd.de - coming next winter
 

Shin Ryu

Routinier

Dabei seit: 23.03.2003

Beiträge: 467

 

2 Zum Seitenanfang

Donnerstag, 26. August 2004, 17:42

Hat sich bereits erledigt. Das thema kann beseitigt werden, wenn jemand will. :)
str8fwd.de - coming next winter
 

NiBurhe

Kaiser

Dabei seit: 07.04.2003

Beiträge: 1 292

 

3 Zum Seitenanfang

Donnerstag, 26. August 2004, 18:25

ist immer praktisch, wenn du noch sagst, woran es gelegen hat, dann haben alle was davon.

MfG
NiBurhe