Jump to content

Switching between desktop and mobile images within a gallery

Recommended Posts

I have two sets of images, one for desktop and one for mobile, each within the same gallery.  The desktop version has a more elaborate layout that will not read in mobile so I want to use css to show/hide depending on the screen size.   I'm using the code below and it's working perfectly except for one issue.  On the desktop version after the last image instead of returning to the beginning you see a black black screen.  The mobile images are hidden but the navigation is still loading the blank pages.  How do I point the link back to the first image?

/* Mobile*/
    @media only screen and (max-width: 800px) {
     #collection-############################### .slide:nth-child(-n + 22) {
      display:none;
     }
      }
 
  /*Desktop */
    @media only screen and (min-width: 800px) {
    #collection-############################### .slide:nth-child(n + 23) {
      display:none;
    }
   }

Link to comment
  • Replies 2
  • Created
  • Last Reply

If you used max-width:800px for mobile, then desktop min-width:799px

also, can you share link to gallery on your site? difficult to help without checking url 

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.