Click to See Complete Forum and Search --> : Open a new window with right-click protection?


foppedlastnight
05-07-2003, 12:15 PM
I need a script that upon clicking a thumbnail will open a new window with right-click protection. I know its hardly effective, but it will make the person I'm doing the site for happy. This is a photography site.

goofball
05-07-2003, 12:23 PM
Just put this code into the <head> section of the pop-up window doc:

<script language="JavaScript">
<!--
document.oncontextmenu = function(){return false}
//-->
</script>

foppedlastnight
05-08-2003, 09:16 PM
That I know. I need to create a page with that protection and the full size image when the thumbnail is clicked. Okay, let me try this.....

1. Click on the thumbnail.
2. Image will open in a new window. That window needs to be protected with that code.

I want a script to do all that. Can you apply the protection script to that idea?

pyro
05-08-2003, 09:25 PM
This thread might be of interest to you... http://forums.webdeveloper.com/showthread.php?s=&threadid=8550 a no-rightclick script could easily be added...

foppedlastnight
05-08-2003, 09:49 PM
I was hoping someone could help me with that part. I have the protection script. I know how to open a window with a click. But I need that window to be automatically protected when its opened.

havik
05-08-2003, 09:50 PM
And here's a no-right click script for NS4+ and IE4+ (doesn't work for Opera 7 though)

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

havik

KeshavaR
05-09-2003, 01:09 AM
Just give oncontextmenu="return false" within your body tag of your window page .

Now you will have your window popping out, already with Right-Click Protection.

Cheers,
- Keshav

A1ien51
05-09-2003, 01:19 AM
If the code you are using is opening the new window that does not contain html, but just the pic, then you are going to have to change the script.

You would have to dynamically write the code to the new window....

Would do something like this

Example Link (http://www.javascriptkit.com/script/script2/popimage.shtml)

There is another method I use too and that is query strings with a templete page.

A1ien51

foppedlastnight
05-09-2003, 08:16 AM
Right. I know that. How do I do it? Can someone show me how to accomplish this?

pyro
05-09-2003, 08:46 AM
I edited my post above to actually include the link to the thread that should help you. You said you know how to include a no-rightclick script on a page, so all you should need to do is add it to either my method, or Dave Clark's

foppedlastnight
05-09-2003, 10:35 AM
I understand how Alien51's code works. Its driven by a form. But how can I change it so that I don't need the form. I want the click of the thumbnail to open the corresponding full size image. I think I figured out how to put my protection script in page generation section, so that should be okay.

I GREATLY appreciate everyone's assistance. Thanks mucho.

foppedlastnight
05-09-2003, 11:00 AM
I've tried to understand this all, but I'm confused, and this is way to indepth for me. I'll take the old fashioned road, and use some HTML pages for all the pics. It'll take forever, but I'm having a way hard time with this. Thanks for your help.

pyro
05-09-2003, 12:09 PM
Did you try the code in the thread that I linked to? If you still haven't gotten that to work, post what you tried (as far as adding a no-rightclick script) and we can help you along...

pyro
05-09-2003, 09:03 PM
If you are still interested, I wrote this research page: http://www.infinitypages.com/research/imagepopup.htm Perhaps it will help you along...

foppedlastnight
05-11-2003, 11:37 AM
Dude, I'm golden now. Thanks so much. Pyro, you da man!!

pyro
05-11-2003, 12:44 PM
Glad it's working for you!