Jamaica

number 1 Producer

Don Corleonie


Check it out!

Click Here


For the latest news.
Check out

News Blog!

Use Google Chrome

to give SOUL Art

a good Look.

Also very useful

for other sites

    Disallow Right-Clicking

    Share
    avatar
    Soul ART
    Fonder & WebDesigner
    Fonder & WebDesigner

    Male Posts : 62
    Join date : 2010-09-06

    Disallow Right-Clicking

    Post by Soul ART on Sat Nov 20, 2010 9:46 am

    There is actually a basic script to use to disable right-clicking; though I don't recommend it as users won't be able to right-click anything else on your site, and that could be important later (especially for admins and mods).


    Here are a few tricks to use:


    1. Using span tag to position a transparent gif overtop of the image.
    Code:
    <span style="background-image: url(images/my_image.jpg)"><img src="images/transparent.gif" width="200" height="150" border="0" alt="My protected Image."></span>


    2. Using CSS to position a transparent gif overtop of the image.
    Code:
    <img src="myimage.gif" width="100" height="50">
    <img src="transparent.gif" width="100" height="50" style="position:relative; left:-102px; top:0px;">

    3. Use the image as a background of a table and fill the cell with a transparent gif.
    Code:
    <table width="100" height="50">
    <tr>
    <td background="myimage.gif">
    <img src="transparent.gif" width="100" height="50">
    </td>
    </tr>
    </table>

    Use a watermark over your demonstration images in the store with a simple editing software (paint will do just fine for something like that), and keep the real images to yourself until they purchase them.


    Or, if you are really willing to try the right-click script; add the following script to any HTML page, over_header_new template, site message, announcement, or portal widget (portal pages are great for stores as, with widgets, you have easier control over the store's layout and can include the below script without having to disable right-clicking for your entire site):

    Code:
    <script type="text/javascript">
    function clickIE() {if (document.all) {(message);return false;}}
    function clickNS(e) {if
    (document.layers||(document.getElementById&&!document.all)) {
    if (e.which==2||e.which==3) {(message);return false;}}}
    if (document.layers)
    {document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
    else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}
    document.oncontextmenu=new Function("return false")
    </script>

    was originally written by Agenda
    and Improve by Sean



    avatar
    Soul ART
    Fonder & WebDesigner
    Fonder & WebDesigner

    Male Posts : 62
    Join date : 2010-09-06

    Re: Disallow Right-Clicking

    Post by Soul ART on Sat Nov 20, 2010 10:03 am

    Test




      Current date/time is Sat Aug 19, 2017 12:36 pm