Jump to content

Hover over thumbnail in desktop causes issues on mobile version

Recommended Posts

Posted

Hi there

I have setup my homepage with show text on hover, for the thumbnails. It works perfectly for desktop browsers and I don't want to change this.  However for mobile devices, the text doesn't show (as the hover function does not work on touch devices).

I therefore want to change this so that only the hover version (the coloured image with text) appears on mobile browsers, without affecting the hover on desktop browser.

How do I keep "show coloured image with text after hover" on the desktop browser and "show coloured image with text" on mobile devices.

Web address is www.gregrawson.com

Thank you!
 

Posted

Suppose you have this code

#block-143916491714d5f2e79c {
    opacity: 0;
    -webkit-transition: opacity .2s ease-in-out;
    -moz-transition: opacity .2s ease-in-out;
    transition: opacity .2s ease-in-out
}

#block-143916491714d5f2e79c:hover {
    opacity: 1
}

you can change it to this, to make code run on desktop only

@media screen and (min-width:992px) {
#block-143916491714d5f2e79c {
    opacity: 0;
    -webkit-transition: opacity .2s ease-in-out;
    -moz-transition: opacity .2s ease-in-out;
    transition: opacity .2s ease-in-out
}

#block-143916491714d5f2e79c:hover {
    opacity: 1
}
}

 

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.