Page 1 of 1

Fancybox image size

Posted: Mon Feb 12, 2018 12:16 pm
by Norfolkman
BaconFries, you very kindly helped me out on a jscript problem back in Sept 2017. I wonder if I could ask your advice again?

It refers to the use of a lightbox on the following example page: beta.mundesley.org
If you click on the Green bar link, the image is displayed full width across the display area.
If you click on the Red bar link, the image is reduced to fit the height, (Both image are exactly the same width). I want all images to display the full width of the display area, as the green one does but regardless of height. (They will scroll down). Obviously, Fancybox is 'fitting to height' rather than to width.

I suspect that there is something in fancybox that needs changing. autoDimensions??

Your advice would be much appreciated.
Geoff

Re: Fancybox image size

Posted: Mon Feb 12, 2018 1:16 pm
by BaconFries
In Fancybox click on the "Settings" button this will open a new window were you can add for example the following:

Code: Select all

width: 800,
height: 600
Take a look at the following url to the Fancy box API for other settings that can be added the same way as mentioned above.
Fancybox

Re: Fancybox image size

Posted: Mon Feb 12, 2018 2:25 pm
by Norfolkman
Thanks for the quick reply.

i have tried this but it doesn't change the WIDTH of the red link, this still does not display full width. As I said, both images are the same width, just the red one is 2000px high. It seems that something in Fancybox is setting it to "Fit to height" instead of "fit to width" but I can't work out what.

Ultimately I will need to display a whole list of images at different heights and I need to display them all at full width.

Re: Fancybox image size

Posted: Mon Feb 12, 2018 3:23 pm
by BaconFries
Hi not at my PC so can't check whether the following autoDimensions can be used or not. I will look at this and give a reply to you later.

Re: Fancybox image size

Posted: Mon Feb 12, 2018 4:49 pm
by Norfolkman
Thank you.
It does fill the width if you click on the red image,so I could live with this if necessary, but it would be cleaner if it started at full width.

UPDATE;
I've just noticed that when viewed on my phone, the width is filled OK!! Must be something to do with Win 10 / Laptop?

Re: Fancybox image size

Posted: Mon Feb 12, 2018 8:03 pm
by rogerl
Try :

Code: Select all

width: 100%,
height: auto

Re: Fancybox image size

Posted: Tue Feb 13, 2018 12:35 pm
by Norfolkman
Tried all of these but none worked.

Many thanks anyway for the ideas.