Problem mit lightbox + Slideshow
Eric
- javascript
Hallo!
Ich habe folgendes Problem. Ich habe auf meiner Website eine Javascript-Slideshow mit einem Script mit dem Namen "lightbox" kombiniert. Dieses bewirkt, dass sich bei click auf einem Bild das einzelne Bild mit einem Fade-Effekt in der Mitte der Seite öffnet.
Jedoch hab ich das Problem, dass die in meinem Slideshow-Skript nicht funktioniert. Außerhalb der Slideshow funktioniert dieses lightbox-Skript jedoch. Inwiefern stören sich die beiden Skripte?
Am besten füge ich mal den Quelltext der Seite hinzu, auch wenn dieser sehr lang ist (Die Url ist: www.bauer-dienheim.de/laura/freunde.html):
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Unbenanntes Dokument</title>
<style type="text/css">
<!--
body {
background-color: #00CCFF;
}
.Stil1 {
font-size: xx-large;
color: darkblue;
}
-->
</style>
<script type="text/javascript" src="js/prototype.js"></script>
<script type="text/javascript" src="js/scriptaculous.js?load=effects"></script>
<script type="text/javascript" src="js/lightbox.js"></script>
<link rel="stylesheet" href="css/lightbox.css" type="text/css" media="screen" />
</head>
<body>
<div align="center" class="Stil1">Freunde</div>
<hr />
<table width="718" >
<tr>
<td height="203" colspan="4" style="border-top:solid #000000 2px; border-left:solid #000000 2px; border-right:solid #000000 2px" bgcolor="#CCCCCC" > </td>
<td width="255" colspan="2"> </td>
</tr>
<tr>
<td width="106" height="93" bgcolor="#CCCCCC" style="border-left:solid #000000 2px; border-bottom:solid #000000 2px"> </td>
<td width="103" bgcolor="#CCCCCC" style="border-bottom:solid #000000 2px"> </td>
<td width="113" height="93" bgcolor="#CCCCCC" style=" border-bottom:solid #000000 2px"> </td>
<td width="117" bgcolor="#CCCCCC" style="border-bottom:solid #000000 2px; border-right:solid #000000 2px"> </td>
<td colspan="2" bordercolor="#000000"> </td>
</tr>
<tr>
<td height="31" colspan="6"> </td>
</tr>
<tr>
<td colspan="2"> </td>
<td height="222" colspan="4" bgcolor="#CCCCCC"> </td>
</tr>
<tr>
<td colspan="2"> </td>
<td height="94" colspan="3" bgcolor="#CCCCCC">
<script type="text/javascript">
/***********************************************
* Conveyor belt slideshow script- © Dynamic Drive DHTML code library (Dynamic Drive DHTML(dynamic html) & JavaScript code library)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at Dynamic Drive DHTML(dynamic html) & JavaScript code library for full source code
***********************************************/
//Specify the slider's width (in pixels)
var sliderwidth="480px"
//Specify the slider's height
var sliderheight="94px"
//Specify the slider's slide speed (larger is faster 1-10)
var slidespeed=2
//configure background color:
slidebgcolor="#CCCCCC"
//Specify the slider's images
var leftrightslide=new Array()
var finalslide=''
leftrightslide[0]='<a href="bild1.jpg" rel="lightbox"><img src="bild1.jpg" border=1></a>' <--------- hier ist das Problem
leftrightslide[1]='<a href="http://"><img src="bild2.jpg" border=1></a>'
leftrightslide[2]='<a href="http://"><img src="bild3.jpg" border=1></a>'
leftrightslide[3]='<a href="http://"><img src="bild4.jpg" border=1></a>'
//Specify gap between each image (use HTML):
var imagegap=" "
//Specify pixels gap between each slideshow rotation (use integer):
var slideshowgap=5
////NO NEED TO EDIT BELOW THIS LINE////////////
var copyspeed=slidespeed
leftrightslide='<nobr>'+leftrightslide.join(imagegap)+'</nobr>'
var iedom=document.all||document.getElementById
if (iedom)
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100px;left:-9000px">'+leftrightslide+'</span>')
var actualwidth=''
var cross_slide, ns_slide
function fillup(){
if (iedom){
cross_slide=document.getElementById? document.getElementById("test2") : document.all.test2
cross_slide2=document.getElementById? document.getElementById("test3") : document.all.test3
cross_slide.innerHTML=cross_slide2.innerHTML=leftrightslide
actualwidth=document.all? cross_slide.offsetWidth : document.getElementById("temp").offsetWidth
cross_slide2.style.left=actualwidth+slideshowgap+"px"
}
else if (document.layers){
ns_slide=document.ns_slidemenu.document.ns_slidemenu2
ns_slide2=document.ns_slidemenu.document.ns_slidemenu3
ns_slide.document.write(leftrightslide)
ns_slide.document.close()
actualwidth=ns_slide.document.width
ns_slide2.left=actualwidth+slideshowgap
ns_slide2.document.write(leftrightslide)
ns_slide2.document.close()
}
lefttime=setInterval("slideleft()",30)
}
window.onload=fillup
function slideleft(){
if (iedom){
if (parseInt(cross_slide.style.left)>(actualwidth*(-1)+8))
cross_slide.style.left=parseInt(cross_slide.style.left)-copyspeed+"px"
else
cross_slide.style.left=parseInt(cross_slide2.style.left)+actualwidth+slideshowgap+"px"
if (parseInt(cross_slide2.style.left)>(actualwidth*(-1)+8))
cross_slide2.style.left=parseInt(cross_slide2.style.left)-copyspeed+"px"
else
cross_slide2.style.left=parseInt(cross_slide.style.left)+actualwidth+slideshowgap+"px"
}
else if (document.layers){
if (ns_slide.left>(actualwidth*(-1)+8))
ns_slide.left-=copyspeed
else
ns_slide.left=ns_slide2.left+actualwidth+slideshowgap
if (ns_slide2.left>(actualwidth*(-1)+8))
ns_slide2.left-=copyspeed
else
ns_slide2.left=ns_slide.left+actualwidth+slideshowgap
}
}
if (iedom||document.layers){
with (document){
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
if (iedom){
write('<div style="position:relative;width:'+sliderwidth+';height:'+sliderheight+';overflow:hidden">')
write('<div style="position:absolute;width:'+sliderwidth+';height:'+sliderheight+';background-color:'+slidebgcolor+'" onMouseover="copyspeed=0" onMouseout="copyspeed=slidespeed">')
write('<div id="test2" style="position:absolute;left:0px;top:0px"></div>')
write('<div id="test3" style="position:absolute;left:-1000px;top:0px"></div>')
write('</div></div>')
}
else if (document.layers){
write('<ilayer width='+sliderwidth+' height='+sliderheight+' name="ns_slidemenu" bgColor='+slidebgcolor+'>')
write('<layer name="ns_slidemenu2" left=0 top=0 onMouseover="copyspeed=0" onMouseout="copyspeed=slidespeed"></layer>')
write('<layer name="ns_slidemenu3" left=0 top=0 onMouseover="copyspeed=0" onMouseout="copyspeed=slidespeed"></layer>')
write('</ilayer>')
}
document.write('</td></table>')
}
}
</script>
</td>
</tr>
</table>
<p> </p>
<table width="718" >
<tr>
<td height="203" colspan="4" bordercolor="#000000" bgcolor="#CCCCCC" > </td>
<td width="255" colspan="2"> </td>
</tr>
<tr>
<td width="106" height="93" bgcolor="#CCCCCC"> </td>
<td width="103" bgcolor="#CCCCCC"> </td>
<td width="113" height="93" bgcolor="#CCCCCC"> </td>
<td width="117" bgcolor="#CCCCCC"> </td>
<td colspan="2"> </td>
</tr>
<tr>
<td height="31" colspan="6"> </td>
</tr>
<tr>
<td colspan="2"> </td>
<td height="222" colspan="4" bgcolor="#CCCCCC"> </td>
</tr>
<tr>
<td colspan="2"> </td>
<td height="94" bgcolor="#CCCCCC"> </td>
<td height="94" bgcolor="#CCCCCC"> </td>
<td height="94" bgcolor="#CCCCCC"> </td>
<td bgcolor="#CCCCCC"> </td>
</tr>
</table>
<p> </p>
<a href="bild1.jpg" rel="lightbox">test</a>
</body>
</html>
Würde mich sehr freuen, wenn ihr mir weiterhelfen könnt.
Gruß
Eric