View Full Version : Help with Conveyor Belt & Lightbox

02-03-2006, 05:56 PM
I was trying to tie these two scripts together cause I think the effect would be awesome. But I keep getting stuck with errors.
Here is what I was trying to do....

leftrightslide[0]='<a href="images/1_full.jpg" rel="lightbox" ><img src="1.jpg" /></a>'
or I was trying

leftrightslide[0]='<a href="images/1_full.jpg" onclick="lightbox" ><img src="1.jpg" /></a>'
neither works, actually I don't even think they are correct syntax.

In lightbox, a simple

<a href="Image1_full.jpg" rel="lightbox" ><img src="1_thumb.jpg" /></a> works to call for the effect, I just can't get it to translate to the conveyor belt script.

I can open pop-ups in conveyor using this

leftrightslide[0]='<a href="#" onclick=NewWindow("images/Image1_full.jpg",\'mywin\',\'500\',\'500\',\'no\',\'center\');return false" onfocus="this.blur()"><img src="Images/Thumbnails/1.jpg" border=1></a>'after reading about it in these forums (thank you to jscheuer1 :D )
...Can I use the same principle to call the lightbox.js? How? I'm stumped and my understanding of javascript is lacking, so I appreciate all the help I can get!:)

http://www.dynamicdrive.com/dynamicindex4/lightbox/index.htm [Lightbox]
http://www.dynamicdrive.com/dynamicindex14/leftrightslide.htm [Conveyor]


02-04-2006, 06:34 AM
Actually, your first syntax looks good:

leftrightslide[0]='<a href="images/1_full.jpg" rel="lightbox" ><img src="1.jpg" /></a>'

The problem appears to be conflict between the two scripts' onload behaviors. This should be able to be resolved by removing this line from the conveyor script (it's about halfway down in the code):


and putting it in an independent script code block in the head of the page before the link to the lightbox script:

<link rel="stylesheet" href="lightbox.css" type="text/css" media="screen" />
<script type="text/javascript">
<script type="text/javascript" src="lightbox.js"></script>

02-04-2006, 08:10 PM
Jscheuer1, Thank you! Thank you!:)

It took alittle more then just moving the window.onload. I realized I had to define the variables, load the array and define the function 'fillup' all before I called for the lightbox.js. But without you pointing out that conflict, I don't think I ever would have got this.


02-11-2006, 08:21 PM
What else was necessary to make window.onload work. I'm afraid I'm new to this and am not sure what is needed. Has anyone an example I can look at?