Lightbox Lite in IE - older versions of Lightbox2

There is an issue with Lightbox Lite in IE browsers but only for sites where Drupal is installed in a subdirectory. In such instances, the overlay.png image can not be found. To overcome this issue you will need to edit the lightbox2/css/lightbox_lite.css file and change the path to this image. By default the line is set to:

filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../images/overlay.png", sizingMethod="scale");

You will need to change the image path on this line to be the full path, e.g.

filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="/sites/all/modules/lightbox2/images/overlay.png", sizingMethod="scale");

See #185866: Relative path in filter: progid:DXImageTransform.Microsoft.AlphaImageLoader not working for more details.

Keyboard Shortcuts in Opera

Not all of the keyboard shortcuts work in the Opera browser, for example 'z' for toggling the zoom and 'spacebar' for toggling play / pause in slideshows. This can be overcome by updating your shortcut settings in the Opera preferences editor.

Performance Issues With Lightbox2, Imagecache, and CCK

See Performance issues with large number imagecache presets and content types for a full discussion. This can be a serious problem for large sites. There are a couple of patches that may help, but no fix in the latest version of Lightbox2.

Comments

Netsurfer’s picture

If you have Lightbox2 not working correctly with Opera 10 then you probably have a CSS rule like this:
html, body {height: 100%;}

Due to a bug in Opera 10 the page height won't be correct if the html and/ or body element has a height given by CSS.
The only solution I found until now is to remove the CSS rule and everything goes fine.

BTW: Feel free to move this post wherever it may fit. I'm new to Drupal and all the sites here, but maybe it helps other users saving some time for investigation.

zegmant’s picture

Lightbox trigger field of Views does not work - in a popup window one can see the whole source page instead of predefined views fields. FF, IE works correctly.

opera 11.5, drupal 6.22, views 2.12, lighbox2 1.11 (everything the freshest). The examle of the wrong behavior here: http://muller.pp.ua/career

Meanwhile lightbox in other cases (not via trigger) works properly - f.e. here images and gmap (Store-locator and Panorama fields) http://muller.pp.ua/tommy_hilfiger

Has anyone some suggestions? It's a real bug.

tommer’s picture

Hi,
I solved the same problem, because I need 100% height of page and I found the solution here: http://drupal.org/node/1285208 . I just put the code into the end of lightbox.js file and all browsers including Opera work perfectly.

Netsurfer’s picture

When you are getting a horizontal scrollbar in Firefox (at least version 3.6 Win) if the page already has a vertical scrollbar this is caused by the circumstance that this scrollbar is not mentioned by the JS pagewidth. For that reason Lightbox2 sets the width of the div#overlay to the total viewport width, which leads to the horizontal scrollbar.

There is quick (& dirty) hack to avoid this (I have not deeply tested any drawbacks, cause it works for me):
- Go to your lightbox2 modul directory and open the lightbox.js file (NOT the lightbox2.js file) from the js subdir.
- Search for the comment "// Adjust the page overlay size." (around line 657)
- Replace the line $('#overlay').css({'height': pageHeight + 'px', 'width': arrayPageSize[0] + 'px'}); with

if ($.browser.mozilla) {
      $('#overlay').css({'height': pageHeight + 'px', 'width': '100%'});
    }
    else {
      $('#overlay').css({'height': pageHeight + 'px', 'width': arrayPageSize[0] + 'px'});
    }

- Done!

Hope it helps. ;-)

Remember: It's not tested with earlier versions of Firefox (normally FF users are up to date).

brian_c’s picture

A better way of fixing the FF horizontal scroll bar is to just add this to your theme's CSS:

#overlay { width: 100% !important; }
jeeba’s picture

Theres an issue with lightbox and views with paging. If you create a views with more than one page, then all the lightboxes will show info of the first page. To remedy this I change the lightbox2_handler_field_lightbox2.inc file line 124 like this:

Before:

  // We don't actually use the link, but we need it there for lightbox to function.
      if (empty($link)) {
        // Get the path name.
        $path = isset($_GET['q']) ? $_GET['q'] : '<front>';
        $link = url($path, array('absolute' => TRUE));
      }

After:

     // We don't actually use the link, but we need it there for lightbox to function.
      if (empty($link)) {
        // Get the path name.
        $path = isset($_GET['q']) ? $_GET['q'] : '<front>';
        //Created By Carlos, look if GET has a page variable and put it on the $path
        if(isset($_GET['page'])){
          $path = $path .'?page='.$_GET['page'];
        }
        $link = url($path, array('absolute' => TRUE));
      }

Hope it help someone with this problem

davery’s picture

This problem shows up with views filters and sortable columns, too.

I think the general fix for all of them is:

        // We don't actually use the link, but we need it there for lightbox to function.
        if (empty($link))
        {
                // Get the path name.
                $path = isset($_GET['q']) ? $_GET['q'] : '<front>';
                $q_items = array();
                foreach($_GET as $key=>$val)
                {
                        if($key != 'q')
                        {
                                $q_items[] = $key . "=" . $val;
                        }
                }
                $query = implode('&', $q_items);
                $link = url($path, array('query' => $query,'absolute' => TRUE));
        }
gMaximus’s picture

I've tried following the instructions in http://drupal.org/node/249830#comment-4935164 to get the trigger to work with exposed filters but without any luck. In that, nothing is displayed in the popup...

Would love any help to get this working for me...

Currently, I'm using this, http://drupal.org/node/770718#comment-3392314 , but getting a warning message...

warning: urlencode() expects parameter 1 to be string, array given in \sites\all\modules\lightbox2\lightbox2_handler_field_lightbox2.inc on line 134.

Thanks in advance,

Guy

I am always interested in paid work... Contact me through Online Business Builders

gMaximus’s picture

I've also noticed that ( http://drupal.org/node/770718#comment-3392314) breaks the light box trigger popup on taxonomy pages...

I am always interested in paid work... Contact me through Online Business Builders

onyxnz’s picture

On D6, you must use the Dev version of Lightbox2 in order to use jquery_update.
Thread here: http://drupal.org/node/411162

Symptoms of failure when using "stable version 6.x-1.9":
Lightbox fails to load for images; they load in new page instead.
Jquery functions fail all over the site, eg Wysiwyg doesn't load, settings-screen roll-ups fail, etc.
Shown in Javascript console: Uncaught Syntax error, unrecognized expression: )

giovanninews’s picture

I apologize to the community for posting in the wrong place my previous posting. I hope this is the right place. Lightbox2 module, the latest version 6.x-1.11 CSS produces errors, perhaps there will have noticed.
The errors are visible at this address: http://giovanninews.com/errori-validazione-moduli-Drupal
Giovanni

beltofte’s picture

Please, post your issue in the issue queue for the specific project and not in the documentation. You find the issue queue at http://drupal.org/project/issues/lightbox2 and click "Create a new issue".

jade.mese’s picture

The character coding has something to do with.