Results 1 to 5 of 5

Thread: no right click

  1. #1
    Join Date
    Aug 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default no right click

    I am using JS to open a new window that contains a lager view of an image.

    How can the "no right click" script be applied to the new window?

    Thanks,

    mm

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Please link to the script in question.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Aug 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default No Right Click

    http://www.dynamicdrive.com/dynamicindex9/noright3.htm

    I am using JS to open a new window that contains a lager view of an image.

    How can the "no right click" script be applied to the new window that opens?

    The "NO RIGHT CLICK" script works fine on the ORIGINAL page (window), but when the new window is opened, the right click function is NOT disabled.

    Thanks,

    mm

  4. #4
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Try:

    Code:
    var oldWinOpen = window.open;
    window.open = function(n) {
    win = oldWinOpen(n);
    if (document.layers) 
    {win.document.captureEvents(Event.MOUSEDOWN);win.document.onmousedown=clickNS;}
    else{win.document.onmouseup=clickNS;win.document.oncontextmenu=clickIE;}
    
    win.document.oncontextmenu=new Function("return false");
    return win;
    }
    It might not work, though. In all honesty, I've quite a bit still to learn about reflection and such in Javascript.
    Last edited by Twey; 08-10-2005 at 08:31 AM.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  5. #5
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    This post may be helpful too.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

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
  •