Topic: Size embed gallery on smartphone [SOLVED]

Hello,

I've embed the gallery
https://pascalriben.com/portfolio_lite_ … _24images/
inside
https://pascalriben.com/?p=231&prev … 64e625fb#6
who is a wordpress theme

I've used and adapted the code from your example page:
https://www.juicebox.net/demos/lite/embedded/

The gallery works fine on my computer but on my smartphone, it's by far too large: I need to find the expand button by moving the page from left to right to have the gallery back to the smartphone width size.


I've noticed that on your example page (https://www.juicebox.net/demos/lite/embedded/) you've
<meta name="viewport" content="width=750"/>

and on wordpress I've
<meta name="viewport" content="width=device-width, initial-scale=1.0">

Not sure if the problem come from here... but anyway, I cannot change the viewport settings.

I know there is a plugin for wordpress but I'm not interested to use it.

Thank you.

Best Regards,

PR

Re: Size embed gallery on smartphone [SOLVED]

The problem is caused by having set a fixed width for your gallery:

galleryWidth:'708'

Your gallery will always have a fixed width of 708px regardless of any parent containers or the size and shape of the browser viewport.

Set a gallery width of 100% instead and your gallery will fill the width of its parent container (and it should adapt to different browser viewport widths).

I hope this helps you to resolve your problem.

Re: Size embed gallery on smartphone [SOLVED]

I cannot believe it... For some reason, I was so sure that I had seen both height and width set at 100% that I didn't even checked it. Really sorry... Many thanks.

Re: Size embed gallery on smartphone [SOLVED]

No problem at all.
I'm glad it was an easy one to fix!