Jump to content

Image hover always on, on mobile?

Recommended Posts

Posted

Help! I have no coding experience whatsoever. Is there a way to make the caption that comes up when hovering on an image block, always 'on' when viewed on a mobile device?

 

Sorry if this is a overasked question, or something simple, or something that just isn't possible. Thank you!!

  • Replies 1
  • Views 1.1k
  • Created
  • Last Reply
Posted

Figured it out! Thanks to: https://stackoverflow.com/questions/2851663/how-do-i-simulate-a-hover-with-a-touch-in-touch-enabled-browsers 

Added this to header code injection: 

<script>
document.addEventListener("touchstart", function(){}, true);
</script>

then added this to custom CSS:

 

element:hover, element:active {
-webkit-tap-highlight-color: rgba(0,0,0,0);
-webkit-user-select: none;
-webkit-touch-callout: none /*only to disable context menu on long press*/
}

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.