PDA

View Full Version : Disabling right click


Paulm
04-15-2001, 11:16 PM
Hey,
does anyone here know the HTML in order to get rid of people right clicking on my site. I have seen it done on other sites and can't seem to find the HTML.
Thanks.

mkcq
04-15-2001, 11:17 PM
you cant find the HTML because it's not HTML it's java script.
you can find the source for free at a javascript site.

Paulm
04-15-2001, 11:34 PM
Oh well that would explain why I couldn't find it.
Thanks for the reply.

mkcq
04-15-2001, 11:36 PM
quick!

everyone rush to paulm's site and steal all his graphics!

heheh

j/k

akide
04-15-2001, 11:37 PM
you could find that javascript as well as many others at www.dynamicdrive.com (http://www.dynamicdrive.com)

^NoLaN^
04-15-2001, 11:39 PM
Just be aware that it's really easy to bypass this script with quick mouse/keyboard work... if you want ill mention how.

akide
04-15-2001, 11:40 PM
sure.. hook us up with the info!

mkcq
04-15-2001, 11:43 PM
script language="JavaScript1.2"

/*
Disable right click script II (on images)- By Dynamicdrive.com
For full source, Terms of service, and 100s DTHML scripts
Visit http://www.dynamicdrive.com
*/

var clickmessage="Right click disabled on images!"

function disableclick(e) {
if (document.all) {
if (event.button==2||event.button==3) {
if (event.srcElement.tagName=="IMG"){
alert(clickmessage);
return false;
}
}
}
else if (document.layers) {
if (e.which == 3) {
alert(clickmessage);
return false;
}
}
else if (document.getElementById){
if (e.which==3&&e.target.tagName=="IMG"){
alert(clickmessage)
return false
}
}
}

function associateimages(){
for(i=0;i<document.images.length;i++)
document.images[i].onmousedown=disableclick;
}

if (document.all||document.getElementById)
document.onmousedown=disableclick
else if (document.layers)
associateimages()
/script



you have to add the <>'s into the script BTW

[ April 15, 2001: Message edited by: mkcq ]

mkcq
04-15-2001, 11:44 PM
Originally posted by ^NoLaN^:
<STRONG>Just be aware that it's really easy to bypass this script with quick mouse/keyboard work... if you want ill mention how.</STRONG>

hell yes it's easy!
if you wanted to you could just save the webpage delete the code and open it again!

Paulm
04-16-2001, 12:00 AM
Thanks for the code. Hey there's not muchto steal anyways. Hahaha :)
Man you guys relpy so fast.

^NoLaN^
04-16-2001, 12:08 AM
No, thats way too much work deleting the code... most of the 'stopping' methods involve a popup dialog, just hit space and IMIDIATELY right click, works no problem with 1 or 2 tries unless theres another method youre using.

will1506
04-16-2001, 12:11 AM
no matter what you do your pics can still be stolen. I mean someone can just down your page then do some editing with the codes offline. I mean I dont' know people have to be so concern. the pic most people got on their sites are probably stolen from others.. haha. it's all a joke.

^NoLaN^
04-16-2001, 12:15 AM
Yeah, the internet is just one big data prostitute house.

Paulm
04-16-2001, 12:17 AM
Originally posted by William:
<STRONG>no matter what you do your pics can still be stolen. I mean someone can just down your page then do some editing with the codes offline. I mean I dont' know people have to be so concern. the pic most people got on their sites are probably stolen from others.. haha. it's all a joke.</STRONG>
Yeah that's true. And now I just found out it can be stolen so many different ways.
Oh well.

mkcq
04-16-2001, 11:39 AM
it's fun to play around with.
heres what i think-

it will add more saftey to your images.
but if someones wants them they can get them easily but it might deter(sp?)some picture theives :)