Jump to content

Is there CSS to block MOBILE from holding on a image and saving it?

Recommended Posts

Is there CSS to block MOBILE from holding on an image and saving it?  I know this code below works on desktop, but on mobile I can still hold an image and get the pop up "save image" and it shows the image url and file name ( this is on iPhone ).  I'd like a way to prevent this on mobile as well.  Does anyone know a way to do this?

This code works on desktop but not mobile.

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.0/jquery.min.js"></script>
<script>
$(document).ready(function () {
  $("body").on("contextmenu",function(e){
    return false;
  });
});
</script>

Link to comment
  • Replies 1
  • Views 1.3k
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Try this:

Please like and upvote if my comments were helpful to you. Cheers!

Zygmunt Spray
Squarespace Website Designer
Contact me: 
https://squarefortytwo.com 
Hire me on Upwork!

🔌 Ghost Squarespace Plugins (Referral link)
📈 SEO Space (Referral link)
 SquareWebsites Plugins (Referral link)
 🔲 SQSP Themes (Referral link) 
Spark Plugin (Referral link) 
 🖼️ Gallery Lightbox Plugin (Referral link) 

 Did I help? Buy me a coffee?

Link to comment

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.