Great looking sites have great looking pictures, most of the times. But some clients invested a lot in creating those pictures and don’t want those pictures to be used by others for different purposes. I understand that, I do. But everything is public on the internet, you can’t go fully blocking access to anything. Unless you force visitors to log in and all such. But those systems aren’t fully safe neither. (Example: I could pull images of private student profiles after searching their unique identifier from an address book in the school’s online environment when I was still a student as well)
But, fancy sites with fancy pictures also have fancy photogalleries. I have used Fancybox most of the time to be able to pop-up the larger version of an image and to navigate to the next of previous image within that pop-up. The piece of code below shows how you can configure Fancybox to block the contextmenu as well. It’s pretty much similar to the code above.
This piece of code makes sure the context-menu is blocked after the pop-up has loaded, but also when the visitor navigates to the next or previous image.