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

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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.