Lightbox not working

I am having trouble getting my installation of Lightbox to function and so far can't figure out why. I believe I have followed all of the steps at http://omeka.org/codex/Adding_LightBox_to_Omeka. To check whether it was a problem on the items-show page or just in general I put a link on my site's home page at the bottom of the left column that is labeled "test image" with the code: test image. This link doesn't seem to recognize the lightbox either. Is this a problem with the javascript files not being recognized/called for some reason?

The site is at http://qcarchives.com/sci/

Thanks!

Whoops, looks like the forum translated the code for the test image into a link. Without the commenting quotes the code is:

<!-- test image -->

One more try! Taking out the <>

a href="http://qcarchives.com/sci/archive/square_thumbnails/01acbfed249dea278e4548a9a2e13d1d.jpg" rel="lightbox" title="my caption" test image /a

I get the following JavaScript error on your site:

Uncaught TypeError: Object #<Object> has no method 'dispatchEvent'

Your site seems to include jQuery more than once, as well as Prototype, and it's likely that some of these are conflicting and causing your lightbox code to fail.

The jQuery code that Omeka normally includes should work fine alongside Prototype, but you add jQuery again (from the "enginel" directory) and don't use the noConflict call that's needed to allow jQuery and Prototype to coexist. Assuming the "enginel" code is compatible with later jQuery versions, which is often the case, you should be able to simply omit the extra jQuery script tag.

The link's probably not the culprit here.

That worked, thanks so much!

Well... it <i>was</i> working, I'm not sure if I changed something while working on other plugins but now the Lightbox is loading very strangely. I'm not sure if this is another code conflict or not. After your response I took out the second JQuery call (which was being used by a slideshow plugin) and the Lightbox appeared as it is supposed to. I moved to working on a separate installation for an audio player plugin (JPlayer) and now if you go to http://qcarchives.com/sci/items/show/1 and click on the file, instead of the proper Lightbox the screen goes to a dark transparency and the image itself opens at the bottom of the screen. I tried removing Lightbox entirely and reinstalling and I am getting the same issue. I removed all code for the JPlayer plugin in case that had been causing an issue. Still no luck, any suggestions as to what is causing this?

On that page I see some JavaScript errors that look like they're related to the Comments plugin.

Try temporarily deactivating the Comments plugin to see if that helps matters.

Comments is now deactivated but it doesn't seem to affect the Lightbox errors

You don't have the Lightbox2 CSS included.

The CSS from "css/lightbox.css" has to either be included in your theme's stylesheet, or you have to have a link tag in your header that loads that stylesheet.

Aiy, that was a silly oversight on my part. Thank you for finding that, all good now!

I'm experiencing the same problem. I've looked at the troubleshooting suggestions in this thread, and here, have double-checked the codex instructions, but can't get Lightbox to work on my site. See example: http://www.ocfallenheroes.com/items/show/35.

I'm using Omeka 1.4.2, the most current version of Lightbox, and the Emiglio theme. Since the Emiglio theme doesn't have its own header.php, I copied it from application/views/scripts and added the header info into that file. My Lighbox images remain in the Lightbox folder since Emigio has no "images" directory -- but I'm poinging my
lightbox.js file to that directory: /themes/emiglio/common/lighbox/images. And I've also copied lightbox.css into my theme's style.css.

Any suggestions on what I should check? Thanks!

The version of Lightbox you downloaded, 2.5, seems to be changed quite a bit from the Lightbox script that the Codex page is talking about.

Instead of using Prototype like the Codex page is expecting, it uses jQuery. Normally this would actually be slightly better, since Omeka already uses jQuery, but Lightbox 2.5 also has a minor issue that makes it not work with jQuery as Omeka loads it.

Argh. Okay. So I need to try to find an older release (2.0) of Lighbox?

Ideally, there'll be an update to the new Lightbox that will fix the issue (I reported it to the developer, but it's a little surprising it's still being updated at all).

For the time being, you should be able to get the version you have working if you tweak the instructions a little:

Instead of

<!-- Start Lightbox includes -->
<script type="text/javascript" src="<?php echo WEB_ROOT;?>/themes/themename/common/lightbox/js/prototype.js"></script>
<script type="text/javascript" src="<?php echo WEB_ROOT;?>/themes/themename/common/lightbox/js/scriptaculous.js?load=effects,builder"></script>
<script type="text/javascript" src="<?php echo WEB_ROOT;?>/themes/themename/common/lightbox/js/lightbox.js"></script>
<!-- End Lightbox includes -->

Try this:

<!-- Start Lightbox includes -->
<script type="text/javascript">
window.$ = jQuery;
</script>
<script type="text/javascript" src="<?php echo WEB_ROOT;?>/themes/themename/common/lightbox/js/lightbox.js"></script>
<!-- End Lightbox includes -->

An update: the Lightbox developer just released a new 2.51 version that fixes the problem I mentioned above.

If you update to that version, you should be able to simplify the javascript down to just the line that includes the Lightbox js:

<script type="text/javascript" src="<?php echo WEB_ROOT;?>/themes/themename/common/lightbox/js/lightbox.js"></script>

Still not working for me, even with the latest version. I'll triple-check all of my code this weekend. Thanks for your help.

Hi,
This issue has been addressed here but Im having a similar problem as cparker030 above. Everything seems to be set up ok but the lightbox doesnt seem to want to display any images. Here is my test site with an item that has several associated files: http://www.granular.ie/archive/items/show/120
if you scroll down and click on one of the thumbnails you can see what I mean. I dont know why it wont display the images.
Appreciate any help if possible, thanks.

I got it working, I called the lightbox.js script before the jquery script calls. Doh.