Archivlink: javarea.de Forum > JavaScript > JS Diashow - Links funktionieren nicht
Vollständigen Link anzeigen: javarea.de Forum > JavaScript > JS Diashow - Links funktionieren nicht

Pages: [1]

geschrieben von federix am 19.09.2006 - 15:37
Hallo,
ich hoffe, ihr könnt mir helfen. Ich habe das JS Diashow von javarea.de heruntergeladen, angepasst und in eine HTML-Seite eingebaut.
So sieht der Quellcode meiner HTML-Seite aus:
HTML-Quelltext
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: 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Unsere Partner</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<table width="200" height="10" border="1" cellspacing="0" bordercolor="#1A4672">
<tr>
<td height="21" bgcolor="#1A4672"><div align="center"><font color="#FFFFFF" size="-1" face="Verdana, Arial, Helvetica, sans-serif">Unsere
Partner...</font></div></td>
</tr>
<tr>
<td height="130"><table border="0" align="center">
<div align="center">

<body onload="slideit()">

<script language="JavaScript1.2">
<!--
function reapply(){
setTimeout("slideit()",2000)
return true
}
window.onerror=reapply

// einbinden der Grafiken
var image1=new Image()
image1.src="http://www.handball-in-zaehringen.de/images2/01_logo_rothaus_188x125.jpg"
var image2=new Image()
image2.src="http://www.handball-in-zaehringen.de/images2/02_logo_herbstritt_188x125.jpg"
var image3=new Image()
image3.src="http://www.handball-in-zaehringen.de/images2/03_logo_neumayer_188x125.jpg"
var image4=new Image()
image4.src="http://www.handball-in-zaehringen.de/images2/04_logo_zypresse_188x125.jpg"
var image5=new Image()
image5.src="http://www.handball-in-zaehringen.de/images2/05_logo_hipp_188x125.jpg"
var image6=new Image()
image6.src="http://www.handball-in-zaehringen.de/images2/06_logo_beka_188x125.jpg"
var image7=new Image()
image7.src="http://www.handball-in-zaehringen.de/images2/07_logo_welte_188x125.jpg"
// -->
</script>

<a href="javascript:slidelink()"
onMouseover="window.status='Jedes Bild hat eine eigene URL';return true"
onMouseout="window.status=''">
<img src="http://www.handball-in-zaehringen.de/images2/01_logo_rothaus_188x125.jpg" name="slide" border=0 style="filter:blendTrans(duration=3)"></a>

<script>
<!--
var number_of_images=7       // Anzahl der Grafiken
var speed=3                           // Geschwindigkeit des Filterübergang
var step=1                             // Schrittanzahl
var image=1                           // Start der ersten Grafik
function slideit(){
if (!document.images)
return
if (document.all)
slide.filters.blendTrans.apply()
document.images.slide.src=eval("image"+step+".src")
if (document.all)
slide.filters.blendTrans.play()
whichimage=step
if (step<number_of_images)
step++
else
step=1
if (document.all)
setTimeout("slideit()",speed*1000+2500)
else
setTimeout("slideit()",speed*1000)
}
function slidelink(){
if (image==1)                                                        // 1 Grafik
window.location="http://www.rothaus.de"
else if (image==2)                                                // 2 Grafik
window.location="http://www.franz-herbstritt.de"
else if (image==3)                                                // 3 Grafik
window.location="http://www.neumayer-holding.com"
else if (image==4)                                                // 4 Grafik
window.location="http://www.zypresse.com"
else if (image==5)                                                // 5 Grafik
window.location="http://www.hipp-endoskopservice.de"
else if (image==6)                                                // 6 Grafik
window.location="http://www.beka-gruppe.de"
else if (image==7)                                                // 7 Grafik
window.location="http://www.weltenet.de"
}
// -->
</script>
</table>
</td>
</tr>
</table>
</body>
</html>


Es funktioniert im Prinzip tadellos, nur die Links zu den einzelnen Werbepartnern können nicht aufgerufen werden. Egal welches Logo angeklickt wird, es wird immer nur der erste Link aufgerufen.
Wie eine Suche im Forum zeigte, hatten auch andere User dieses Problem, die aufgezeigten Lösungen führten bei mir aber nicht zu dem gewünschten Erfolg.
Könnt ihr mir weiterhelfen?
Danke und viele Grüße
Stefan

P.S.:
Wie muss der Code lauten, wenn ich die Links in separaten Fenstern öffnen möchte?

geschrieben von Klaush am 19.09.2006 - 17:51
Der Fehler ist gefunden!

mach aus:

HTML-Quelltext
1: 
2: 
3: 
4: 
5: 
6: 
7: 
8: 
9: 
10: 
11: 
12: 
13: 
14: 
15: 
16: 
function slidelink(){
if (image==1)                                                        // 1 Grafik
window.location="http://www.rothaus.de"
else if (image==2)                                                // 2 Grafik
window.location="http://www.franz-herbstritt.de"
else if (image==3)                                                // 3 Grafik
window.location="http://www.neumayer-holding.com"
else if (image==4)                                                // 4 Grafik
window.location="http://www.zypresse.com"
else if (image==5)                                                // 5 Grafik
window.location="http://www.hipp-endoskopservice.de"
else if (image==6)                                                // 6 Grafik
window.location="http://www.beka-gruppe.de"
else if (image==7)                                                // 7 Grafik
window.location="http://www.weltenet.de"
}


das hier:
HTML-Quelltext
1: 
2: 
3: 
4: 
5: 
6: 
7: 
8: 
9: 
10: 
11: 
12: 
13: 
14: 
15: 
16: 
17: 
function slidelink()
{
	if (whichimage==1)                                                        // 1 Grafik
		window.location="http://www.rothaus.de"
	else if (whichimage==2)                                                // 2 Grafik
	window.location="http://www.franz-herbstritt.de"
	else if (whichimage==3)                                                // 3 Grafik
	window.location="http://www.neumayer-holding.com"
	else if (whichimage==4)                                                // 4 Grafik
	window.location="http://www.zypresse.com"
	else if (whichimage==5)                                                // 5 Grafik
	window.location="http://www.hipp-endoskopservice.de"
	else if (whichimage==6)                                                // 6 Grafik
	window.location="http://www.beka-gruppe.de"
	else if (whichimage==7)                                                // 7 Grafik
		window.location="http://www.weltenet.de"
}


Ich hoffe Du erkennst den Unterschied?

geschrieben von federix am 19.09.2006 - 19:55
Hallo Klaus,
super, nun funktioniert es. Warum erschließt sich mir leider nicht auf den ersten Blick, aber vielleicht lerne ich es ja noch.
Vielen Dank
Stefan


Powered by: JBB v.2.0.4 Copyright ©2000-2006, www.javarea.de.