Jump to content

Max-Width for Images in Lightbox?

Go to solution Solved by Beyondspace,

Recommended Posts

Site URL: https://erikanorris.com/bitesized-series

Hi,

I have a gallery which opens images into a lightbox. It looks like the height of the screen determines the width of the image, so unfortunately, some of my images are displaying at almost the full width of my 27" iMac. The image size is 2500px as suggested, but I don't want them to display so large. Is there any way to set a max-width so that my images can be displayed at a more natural size? 

The website is: https://erikanorris.com/bitesized-series

I have increased some of the padding around the images to make them a bit smaller, but for the really widescreen images it is not enough.

I am also trying to figure this out for my product pages, but all the images in the product pages are the same aspect ratio, so it isn't as big of an issue.

Thanks!

Erika

Link to comment
  • Solution

I made a breakpoint at 1440px, hope it fit your screen dimension, put it in Design->Custom Css

@media only screen and (min-width: 1440px) {
  .sqs-lightbox-padder img {
        max-width: 800px !important;
        height: auto !important;
        left: 50% !important;
        top: 50% !important;
        transform: translate(-50%, -50%);
  }
}

 

Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Keyword Highlighter
If you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you

Link to comment
  • 5 months later...
On 11/7/2020 at 4:41 AM, bangank36 said:

I made a breakpoint at 1440px, hope it fit your screen dimension, put it in Design->Custom Css


@media only screen and (min-width: 1440px) {
  .sqs-lightbox-padder img {
        max-width: 800px !important;
        height: auto !important;
        left: 50% !important;
        top: 50% !important;
        transform: translate(-50%, -50%);
  }
}

 

Hello, I have a simple grid gallery I am trying to apply this to but I cannot make it work, any tips??

Link to comment
On 4/11/2021 at 4:48 AM, creativesurfing said:

Hello, I have a simple grid gallery I am trying to apply this to but I cannot make it work, any tips??

Can you share link to page wherre you use gallery grid? We can tweak code easier

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

Link to comment
  • 2 weeks later...
3 hours ago, creativesurfing said:

@tuanphan @bangank36 , not sure what is going on - it was working ok and now its not working again.

 

The code I am using is exactly as above and its on a simple gallery grid that I'm having the size problems.

 

/* reduce size of lightbox */
@media only screen and (min-width: 1440px) {
.sqs-lightbox-padder img {
        max-width: 800px !important;
        height: auto !important;
        left: 50% !important;
        top: 50% !important;
        transform: translate(-50%, -50%);
  }}

 

Do you know some reason why this wouldn't be working? Projects page, first project and then scroll down to 'project development' grid, thank you 

What is your site url

Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Keyword Highlighter
If you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you

Link to comment
  • 11 months later...

Have you tried refresh the result on Incognito mode. Maybe the bug of preview does not make you get it

Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Keyword Highlighter
If you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.