Results 1 to 5 of 5

Thread: question about using HTML code in Disable right mouse click script

  1. #1
    Join Date
    Nov 2014
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default question about using HTML code in Disable right mouse click script

    I am using your Disable right mouse click script on a website and was wondering if it is possible to place HTML code in the message appearring on screen.
    I have tried with a <br /> to "cut" the line in two, but the only reslut is that <br /> is now appearring in the message.

    The complete message is: Copyright name owner site. All rights reserved. Please contact me for licensing information.
    I would lik to have he last line (Please contact me for licensing information.) on the second line in the message.

    Is there a way somebody can help me out with this?

  2. #2
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    3,033
    Thanks
    25
    Thanked 599 Times in 575 Posts
    Blog Entries
    40

    Default

    Warning: Please include a link to the DD script in question in your post. See this thread for the proper posting format when asking a question.
    Focus on Function Web Design
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps

  3. #3
    Join Date
    Sep 2007
    Location
    The Netherlands
    Posts
    1,881
    Thanks
    49
    Thanked 266 Times in 258 Posts
    Blog Entries
    56

    Default

    Try:
    Code:
    Copyright name owner site. All rights reserved. \nPlease contact me for licensing information.

  4. #4
    Join Date
    Nov 2014
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks, now there are 2 lines.
    In order the first question: is it also possible to line the text in the center?
    HTML would say <center>, but perhaps there is another code for this?

  5. #5
    Join Date
    Sep 2007
    Location
    The Netherlands
    Posts
    1,881
    Thanks
    49
    Thanked 266 Times in 258 Posts
    Blog Entries
    56

    Default

    No, you can't center the text, because it shows in a standard alert.
    You can make a custom alert, though, which allows normal HTML. Try this script (in the head of your page):
    Code:
    <script >
    function disable_rc()
    {
    if(!document.getElementById('disable_rc')){document.body.innerHTML+="<div id='disable_rc' style=\'position:fixed;top:50%;left:50%;\'><\/div>"; }
    document.getElementById('disable_rc').innerHTML='<div style="position: fixed; margin-left: -165px; margin-top: -25px;" ><div style="position: fixed; color: white; background: grey; cursor: pointer; padding-left: 2px; padding-right: 2px; font-family: verdana; font-size: 13px; font-weight: bold;z-index: 1; margin-top: 0px; margin-left: 320px" onclick="document.getElementById(\'disable_rc\').innerHTML=\'\'">X<\/div><\/div><br><iframe name="ifr" id="ifr"  style="position: fixed;left: 50%; top: 50%;width:333px;margin-left: -165px;margin-top: -25px;height:50px;border: 1px solid silver" frameborder="0" onload="frames[\'ifr\'].document.body.innerHTML=\'<span style=&quot; font-family: verdana; font-size: 12px; display: block; text-align: center;&quot;>Copyright name owner site. All rights reserved. <br>Please contact me for licensing information.</span>\'"></iframe>';return false;
    }
    
    if (document.addEventListener) {
    document.addEventListener('contextmenu', function(e) {
    disable_rc();
    e.preventDefault();
    }, false);
    } else {
    document.attachEvent('oncontextmenu', function() {
    disable_rc();
    window.event.returnValue = false;
    });
    }
    </script>

Similar Threads

  1. Disable right mouse click script II (on images)
    By newbeeold in forum Dynamic Drive scripts help
    Replies: 5
    Last Post: 07-25-2006, 08:55 PM
  2. Disable right mouse click script
    By Jim Weinberg in forum Dynamic Drive scripts help
    Replies: 5
    Last Post: 02-01-2006, 07:49 PM
  3. Replies: 8
    Last Post: 12-22-2005, 11:43 AM
  4. Disable right mouse click script
    By skidmore33 in forum Dynamic Drive scripts help
    Replies: 2
    Last Post: 08-09-2005, 12:10 AM
  5. Disable right mouse click script
    By skidmore33 in forum ASP
    Replies: 2
    Last Post: 08-09-2005, 12:10 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •