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
  • Views 393
  • Created
  • Last Reply

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.