Jump to content

disabling lightbox on mobile only (product page)

Go to solution Solved by tuanphan,

Recommended Posts

Posted

Hello,

I am trying to disable lightbox functionality on mobile only, because you cannot zoom in with your fingers.

I saw some posts on disabling it on gallery page and the code didn't work on my product page.

any idea?

 

thank you,

samer

  • 3 weeks later...
Posted

Hello,

Sorry for the late reply, I wasn't notified.

https://helix-triangle-pdrn.squarespace.com/shop/p/lounge-tunic-lyns8

password: tempo

that's the code in the custom css:

.gallery-lightbox-item {
  height: auto !important;
  width:100% !important;

}

.gallery-lightbox-wrapper {
  overflow-x: scroll !important;
  overflow-y: none  !important;
  width:100% !important;

}

 

currently, lightbox shows for both mobile and desktop.

I want it only for desktop because i cannot zoom inside mobile when in lightbox view.

 

thank you,

Samer

 

  • Solution
Posted
34 minutes ago, sam_sam said:

Hello,

Sorry for the late reply, I wasn't notified.

https://helix-triangle-pdrn.squarespace.com/shop/p/lounge-tunic-lyns8

password: tempo

that's the code in the custom css:

.gallery-lightbox-item {
  height: auto !important;
  width:100% !important;

}

.gallery-lightbox-wrapper {
  overflow-x: scroll !important;
  overflow-y: none  !important;
  width:100% !important;

}

 

currently, lightbox shows for both mobile and desktop.

I want it only for desktop because i cannot zoom inside mobile when in lightbox view.

 

thank you,

Samer

 

Add to Design > Custom CSS

/* Disable lightbox mobile */
@media screen and (max-width:991px) {
.ProductItem-gallery-slides {
    pointer-events: none;
}
}

 

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

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

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.