I’m using sparkling to post some original works of art online and I would prefer if viewers were not able to right-click on the images of the artwork and save them. I have found some javascript online which serves to disable the right-click function. It must be inserted into the body of the page it’s serving. I am looking through the php script of sparkling and I think I might bugger something up if I fiddle around too much.
Any help would be very much appreciated!
This is the script I found online, but it’s not php script:
Disable Right-Click
Open the HTML file of your webpage in a word processing program.
Add the following code within the <BODY> section of the file:
<SCRIPT LANGUAGE="javascript">
function click() {
if (event.button==2) {
alert('Sorry, this function is disabled.')
}
}
document.onMouseDown=click
</SCRIPT>