I mainly use colorbox to display groups of images at full-size, so I have set the maximum width and height settings to blank on the configuration page.

I have 1 page, however, where I would like the images to scale to 100% of the browser window. How would I do this?

So far, I have been trying to do it using the height and width options like this:

<a href="img.jpg?width='100%'&height='100%'" class="colorbox" rel="image_group"></a>

or

<a href="img.jpg?width=100%&height=100%" class="colorbox" rel="image_group"></a>

Comments

frjo’s picture

Enable "Colorbox load" in the configurations and then change the class from "colorbox" to "colorbox-load".

max6166’s picture

Thank you, frjo.

The height and width values did work after I changed to colorbox-load, but I also realized that I had chosen the wrong behaviour.

What I would like is for the images on just 1 page to scale to fit in the browser window. I think the parameters for this actually are:

<a href="img.jpg?maxWidth='90%'&maxHeight='90%'&scalePhotos='true'" class="colorbox" rel="image_group"></a>

Unfortunately, this doesn't seem to work with "colorbox-load". Any help would be appreciated.

frjo’s picture

Check out this patch https://drupal.org/node/1161342#comment-4489300. It will allow any parameter so should fix your problem.

If it works well for you I will commit it to 7-dev.

max6166’s picture

Thank you very much, frjo! The parameters patch fixed everything!

lsolesen’s picture

Status: Active » Closed (fixed)