# jQuery Lightbox not working



## rmb (Jul 9, 2008)

Hi,

I am using Lightbox for a photo gallery and can't get it to work. If anyone can try find the problem I would really appreciate that as I've debugged for hours.

http://www.rentinkavarna.com/bulgaria/kavarna_gallery.htm 

I have used this script:
http://leandrovieira.com/projects/jquery/lightbox/

and also tried the one on this site:
http://www.huddletogether.com/projects/lightbox2/

Both give same problem. Image opens with no effect. 

I have also optimized all the url paths for the images, js and css files to read from the correct place, it's possible I've missed some. It could also be a javascript clash with some other jQuery I've built??? Who knows, please help.

Thank You!


----------



## Redcore (Aug 14, 2007)

On the example page for lightbox, I see code used (to initialize the plugin) that you're not using...


```
<!-- Ativando o jQuery lightBox plugin --> 
<script type="text/javascript"> 
	$(function() {
		$('#gallery a').lightBox({fixedNavigation:true});
	});
</script>
```
...and there's some funky code here:

```
<body onload="MM_preloadImages("../images/menu_on.gif")…;initLightbox()">
```


----------



## rmb (Jul 9, 2008)

I've put in that code, and want you to see what happens as I was getting this before. 

I sort of get half the effect. Click the image, scroll down the page and the larger image is right at the bottom, then if you click that larger image I get the fade and then the larger image disappears.. Wierd.

The body onload I read on 1 of those sites was a fix for the image opening on a blank page on it's own, but it didn't work anyway so I've taken it out.


----------



## Redcore (Aug 14, 2007)

Hmm. Now it's venturing into territory I'm less up to par with (div/css layouts).

For now, try taking out the " rel="lightbox[a]" " that is in every link. Perhaps that is confusing the plugin. Beyond that, it's probably a layout issue. At that point, hopefully somebody with div layout experience can help get it figured out.


----------



## rmb (Jul 9, 2008)

Thanks... I took " rel="lightbox[a]" out the first image but still does the same thing. That piece of code is just for previous/next links/buttons on the images (which aren't appearing). The layout should be fine, I've double checked that all my divs are closed.

I've also tried taking out the other js file slideshow.js but same thing happens. I've updated to latest version of jQuery. This is not making sense 

Thanks for helping.


----------

