How to Customize Right-Click Protection Message

garrettm30garrettm30 Registered Users Posts: 37 Big grins
edited August 13, 2013 in SmugMug Customization
I found a way to put my own custom message in the right-click protection message. I think it is fair to call this a hack, but so far it seems to work in the Safari, Firefox, Chrome, and IE. You can drop this in your site-wide CSS:
/*Custom right-click protection message*/
.sm-right-click-message span:after {
    content: "[COLOR=Yellow]I ask that you please don't download my images or post them elsewhere. Contact me if you have questions.[/COLOR]";
    background-color: rgb(74,74,74);
    position: absolute;
    top: 0;
    left: 0;
    width: 200px;
    height: 58px;
    padding: 6px 8px 6px 8px;
}
You can replace the yellow text with your own message. Be sure you leave the double quotes on either end. If your message is too long, you can increase the height from 58px until it fits. However, 58px is the minimum to cover up the default message.

Browser support should be Safari 4+, all versions of Chrome, IE8+, Opera 4+, and Firefox 3.5+. Versions earlier than these should just display the default message, with the exception of versions of Firefox earlier than 3.5, which apparently will show your message after the default message. But the far vast majority of Firefox users are at least on 3.5.

Let me know if anyone finds a more elegant way to do this, or if there are any compatibility problems.
Sign In or Register to comment.