Closed (outdated)
Project:
Lightbox2
Version:
5.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
22 Sep 2009 at 00:03 UTC
Updated:
6 Sep 2018 at 08:37 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
elsvandeveire commentedAnyone?
Comment #2
nbchip commentedi found out that this works for FF 3, chrome 3, IE 8... didnt test others
but maybe it would be better to position LB as fixed, like thickbox does.
Comment #3
andrewsuth commentedNice solution.
But how did you determine when lightbox2 was opened and closed in order to change the overflow on Body?
I also looked at making lightbox2
position:fixedbut I couldn't get it to happen. Any heads-up on that one?Comment #4
andrewsuth commentedNow I think I understand, you hacked the lightbox2.js file and added the jQuery
$(body).code.I also tried this, adding the code to:
and to:
This is a nice hack but it doesn't work with IE6/7 or Opera. There are not evil side-effects, the changes to the body element just don't seem to take effect.
I think something like this (that actually works) is a much needed feature of LIghtbox2. My users number one gripe is losing the lightbox on the screen...
Does anyone know a method that works well with IE6/7?
Comment #5
andrewsuth commentedI have been working on this hack to get it to work in all browsers using the 6.x branch.
Basically, it serves my purpose but is clearly not a perfect solution. The reason is because it allows the lightbox to be
position:fixedfor all browsers tested (Chrome, FF, Opera, Safari, IE7+) with the exception of IE6 (which is assigns absolute position, as per the default of Lightbox). Another issue is that it usesIE expressions.. which we all know are to be avoided as much as possible.I see this as acceptable for the moment because non-IE6 users will get the benefits of this feature, while IE6 users will just get the default (lightbox can be scrolled up and down - potentially losing it on the screen). Like I said, not ideal but it's fine by me.
The reason it has issues with IE6 is because of the well-known
position:fixedbug, which in this case I couldn't manage to work-around - it was causing all sorts of issues because of the various positioning of different DIV's in Lightbox.Here's my solution, suggestions welcome on how to improve it:
Firstly, I added this to my
style.cssI then had to hack the code in
lightbox.jsto remove the top from being set in JavaScript, instead adding the value to a variable in the Lightbox DOM object.(about line 400)
I then added this to my
ie.css(conditional CSS for IE 6 only)If anyone has a better solution, please let me know.
Comment #6
elsvandeveire commentedHi
could you explain in which document you've changed this (or added this)?
I'm working with Drupal 6.
I've added a screenshot of the scrollbars in the lightbox.
Els
Comment #7
andrewsuth commented@elsvandeveire: the issue we were discussing is different from the issue you've got.
For your problem you will probably need to change the size of the lightbox2 wrapper around your content.
Use the Firebug plugin for FireFox to find the DIV id and then change the height and width in the CSS for your theme.
Comment #8
elsvandeveire commentedTx!
Comment #9
mherb204 commented#4
That worked! Thanks!!! however, the code was in lightbox.js not lightbox2.js
Just for anyone else looking for this solution.
Comment #10
volegerDrupal 5.x is unsupported. Closing an issue.