I found a problem when using Lightbox2 to display pictures. Normally, when Lightbox activated, the whole content area of brower becomes transparent dark grey and the picture is shown just at the center with white background. However, by Denver theme under IE6, only left half becomes transparent dark grey and the picture is also at left side. Please refer to the screenshot attached.
I tried Denver with IE7. Lightbox functioned correctly. I tried themes like garland, bluemarine and others with IE6. Lightbox worked well, too.
By the way, I use Image module for my pictures.

CommentFileSizeAuthor
screen.jpg92.41 KBartrow

Comments

artrow’s picture

Project: Denver » Lightbox2
Version: 5.x-1.x-dev » 5.x-2.5
Category: bug » support

need help!

stella’s picture

Project: Lightbox2 » Denver
Version: 5.x-2.5 » 5.x-1.x-dev
Category: support » bug

This sounds like a problem with the theme rather than the module I'm afraid. I don't have an instance of IE6 (only IE7) installed, so I can't even reproduce the issue.

Cheers,
Stella

dda’s picture

Hello,

I'm experiencing the same problem described by artrow.

Indeed it's probably an issue with the Denver theme's Javascript for IE6, since Lightbox works fine in FF.

Stella, would you please mind giving it a try ?

I'm no Javascript expert and exploring the complex interactions between Lightbox and the Denver theme
is far beyond my possibilities...

Lots of people are still using IE6, because IE7 breaks lots of existing websites.

"Multiple IE's" allows you to run several instances of IE on the same machine.
Multiple IE
Multiple IE - IE7_standalone

Thank you in advance!

Cheers,
Dan

stella’s picture

I don't believe the issue is a javascript one. It's more than likely a CSS one. I've been able to reproduce it in the Denver theme in IE6 but I'm not familiar enough with the workings of the Denver theme to provide any assistance. The Denver theme maintainer should hopefully be able to help you.

Cheers,
Stella

dda’s picture

Status: Active » Needs review

Solution!

Stella, you were right and I'm glad to say I've finally found a solution!

The problem is IE not interpreting width: 100%; on #lightbox.

I forced it to understand by mean of a Dynamic Expression.

To solve this issue:

  1. Upgrade Lightbox 2 to the most recent version
  2. In your_site/admin/settings/performance, disable CSS aggregation
  3. In file your_site/themes/denver/hacks/ie.css, add the following line:

    #lightbox {
      width: expression(document.compatMode=='CSS1Compat'? document.documentElement.clientWidth+'px' : body.clientWidth+'px');
    }
  4. Re-enable CSS aggregation and force reload the page

Voilà! Now IE6 behaves as expected.

Cheers,
Dan

BTW: Lightbox2 really rocks! Thank you for providing and actively supporting this brilliant module!

colorado’s picture

Hi,

Thank you for reporting this and sharing a fix!

Please let me know if/what I can add/change in the code of the Denver Theme to prevent this problem...

dda’s picture

Hi,

You are most welcome. Thank you for releasing the Denver Theme :-)

Honestly I don't know if/what you could do in the Denver Theme code. I've tried to understand the reason, but couldn't find it. Further investigating this issue, which only affects IE6 (hopefully on its way to become obsolete), would take too much time and effort to my opinion, hence the fix using proprietary code and only in the ie css file.

Cheers,
Dan

colorado’s picture

Status: Needs review » Closed (fixed)
sylvain_a’s picture

Yay! The solution in comment #5 works on IE6 and is a good solution (not just within the Denver theme).

#lightbox {
  width: expression(document.compatMode=='CSS1Compat'? document.documentElement.clientWidth+'px' : body.clientWidth+'px');
}
kalyanrevadi’s picture

The Above Solution Works. Another simple solution for IE6 is to use offsetwidth and height i.e,

height:expression(document.compatMode=='CSS1Compat'? document.body.offsetHeight+'px' : document.body.offsetHeight+'px');
width: expression(document.compatMode=='CSS1Compat'? document.documentElement.offsetWidth+'px' : body.offsetWidth+'px');

or

simply:

height: document.body.offsetHeight;
width: document.body.offsetWidth;

Hope this helps.

Cheers,
Kalyan Revadi

taisei516’s picture

THANK U comment #5!!

it is amazing info!!!