Hello:

I would like to have two different lightbox styles used on my site.

One needs an overlay with a background color of white with an opacity of 1.
The other can have the default black background color with an opacity of 0.7.

Currently if I change the overlay settings in admin/settings/lightbox2 they affect all lightboxes used on my site.

How can I get around this?

Thanks

CommentFileSizeAuthor
#1 Kwiecien2007(242).jpg215.88 KBpiotr581
#1 Kwiecien2007(249).jpg258.21 KBpiotr581

Comments

piotr581’s picture

Version: 6.x-1.11 » 6.x-1.x-dev
Assigned: Unassigned » piotr581
StatusFileSize
new258.21 KB
new215.88 KB
Matt-H’s picture

How do you distinguish between the two styles of lightboxes? Are you wanting both styles of lightboxes to appear on the same page (which could be a problem). If not - if it is based off of the url - then you will probably need to run jquery to override the values on those certain pages.

Source Perrier’s picture

Matt:

Thanks for your response. I do (did) want both styles to appear on the same page, and tried to use jQuery to override the values, but was unsuccessful in setting the opacity property.

I have abandoned using two lightbox styles on the same page as a result :)

Cheers!

Matt-H’s picture

Within your jQuery, you might try something like this:

Drupal.behaviors.mymodule = function(context) {
  if(typeof Lightbox.origInitialize != 'function') {
    Lightbox.origInitialize = Lightbox.initialize;
    Lightbox.initialize = function() {
      Drupal.settings.lightbox2.overlay_opacity = 0;
      Lightbox.origInitialize();
    };
  }
};

What this is doing is saving Lightbox.initialize as Lightbox.origInitialize, then redefining Lightbox.initialize so that the overlay opacity is set to 0 before the real initialize is done.

This is similar to what I talk about in http://drupal.org/node/1086868#comment-4217898 for modifying the template. It uses the same kind of technique of mildly redefining the functions within the Lightbox object.

timd.mackey’s picture

subscribe

timd.mackey’s picture

Assigned: piotr581 » Unassigned

I don't know what that guy was doing, but this issue should not have been assigned to him.