Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 0

Switching between desktop and mobile images within a gallery


mjcurry

Question

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 post
  • Answers 2
  • Created
  • Last Reply

Top Posters For This Question

Top Posters For This Question

2 answers to this question

Recommended Posts

  • 0

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 

You can send your question to my email to get faster answer. / How to Setup Password & Share URL 

-- I'm Tuan, work for a non-profit project (build free libraries). I check the forum once or twice a day to help out the community. If you don't see me answering your question, you can send it to the email above. 

Link to post
  • 0

Hi @tuanphan.  I switched the desktop to 799px but it didn't help the problem.  The site is still private so I'll direct message with a link.

Link to post

Create an account or sign in to comment

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


×
×
  • Create New...