View Full Version : Lightbox 2.04 javascript error

06-17-2008, 02:13 PM
1) Script Title: Lightbox 2.04

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex4/lightbox2/index.htm

3) Describe problem: I get an javascript error the first time I open each picture. Everything works fine but I get the error. The error message is :

Line: 1922
Char: 9
Error: Invalid argument

This is located in the prototype.js file:

setStyle: function(element, styles) {
element = $(element);
var elementStyle = element.style, match;
if (Object.isString(styles)) {
element.style.cssText += ';' + styles;
return styles.include('opacity') ?
element.setOpacity(styles.match(/opacity:\s*(\d?\.?\d*)/)[1]) : element;
for (var property in styles)
if (property == 'opacity') element.setOpacity(styles[property]);
elementStyle[(property == 'float' || property == 'cssFloat') ?
(Object.isUndefined(elementStyle.styleFloat) ? 'cssFloat' : 'styleFloat') : property] = styles[property];
return element;

any idea why this happens?

06-18-2008, 03:41 AM
Do you notice this on the demo page, if not:

Please post a link to the page on your site that contains the problematic script so we can check it out.

See these threads for proper posting format when asking a question.

06-18-2008, 03:49 AM
1) Script Title: Lightbox 2.04

I don't know if that's just a typo or what, but the script here on DD is v2.03a. Version 2.04 is fairly different and not all of the support files are interchangeable.

If you are mixing the scripts, that could be an issue. A link to your page would help. Also, what browser are you getting this error in?