Lightbox works on one page, but not another

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
Paul J
Forum Members
Forum Members
Posts: 52
Joined: Tue Feb 02, 2010 6:51 pm

Lightbox works on one page, but not another

Post by Paul J »

I was wondering if anyone might be able to help with something that's been puzzling me recently. I have a site where a news article features three small images which I've linked to LightBox in TinyMCE. This news article appears on two different pages of the website. Both pages use different templates, although I've added the code for Lightbox:

Code: Select all

{LightBox action='css'}
{LightBox action='js'}
into the 'options' tab of each page, rather than the template.

One one page, it works as expected; on the other, clicking on the thumbnails just opens them up in the standard way. I've checked the source code for both pages, and they both load the Lightbox code:

Code: Select all

<link rel="stylesheet" href="http://www.mysite.com/modules/LightBox/css/lightbox.css" type="text/css" media="screen" />

<!-- debug: dir = http://www.mysite.com/modules/LightBox -->
<!-- debug: lbdir = http://www.mysite.com/modules/LightBox -->
<__script__ type="text/javascript">
var fileLoadingImage = "modules/LightBox/images/loading.gif";
var fileBottomNavCloseImage = "modules/LightBox/images/closelabel.gif";
var overlayOpacity = 0.8;
var animate = true;
var resizeSpeed = 7;
var borderSize = 10;
var imgMaxWidth=1000;
var saveImage=true;
</__script>
<__script__ src="modules/LightBox/js/prototype.js" type="text/javascript"></__script>
<__script__ src="modules/LightBox/js/scriptaculous.js?load=effects" type="text/javascript"></__script>
<__script__ src="modules/LightBox/js/lightbox.js" type="text/javascript"></__script>
The only thing I can think of that is different on the respective pages is that on the one where it doesn't work, there is also some page-specific meta data in the 'options' tab:

Code: Select all

{CGFeedMaker action='autodiscovery' feed='my-feed'}
although I don't suppose that's anything to do with it?

Does anyone have an idea what's happening/what I'm doing wrong?

Thanks in advance!

CMS 1.8.2 (yes, I know I should upgrade: hanging on for 1.9.3!), News 2.10.6, LightBox 1.0.1, CGFeedmaker 1.0.11 are the versions of the modules I've mentioned.
Sonya

Re: Lightbox works on one page, but not another

Post by Sonya »

You can try to debug it with Firebug to see if there are some JavaScript errors.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Lightbox works on one page, but not another

Post by Dr.CSS »

The best way to help you would be to get a link to those 2 pages...
Paul J
Forum Members
Forum Members
Posts: 52
Joined: Tue Feb 02, 2010 6:51 pm

Re: Lightbox works on one page, but not another

Post by Paul J »

Dr CSS: I appreciate that, although I'm coy about posting URLs of live sites here.

Sonya: I'll bear that in mind. I actually use iCab (wonderful, but little-known German browser with an excellent inspector for debugging). I've just checked with it (never thought to look in the 'scripts' section before: oops!) and it says, in relation to /modules/LightBox/js/lightbox.js, on line 108, that:

Code: Select all

TypeError: Result of expression 'element.style' [undefined] is not an object.
Which doesn't mean a lot to me at the moment, so I don't know if that's anything to do with the problem. I'll investigate further. If I get stuck, I'll perhaps investigate with Firebug to see if that gives me any more pointers.

Thanks both!
Post Reply

Return to “Modules/Add-Ons”