PDA

View Full Version : no right click



monty mattox
08-09-2005, 05:39 PM
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

Twey
08-09-2005, 06:06 PM
Please link to the script in question.

monty mattox
08-09-2005, 09:51 PM
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

Twey
08-10-2005, 08:29 AM
Try:



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.

jscheuer1
08-10-2005, 07:32 PM
This post (http://www.dynamicdrive.com/forums/showpost.php?p=13462&postcount=9) may be helpful too.