Log In · Register

 
Forbid Right Click, Help!
lpdrummer
post Apr 19 2005, 05:38 PM
Post #1


Senior Member
****

Group: Member
Posts: 137
Joined: Feb 2005
Member No: 103,647



When I put this

var message="rawr.";
function click(e) {
if (document.all) {
if (event.button==2||event.button==3) {
alert(message);
return false;
}
}
if (document.layers) {
if (e.which == 3) {
alert(message);
return false;
}
}
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=click;
// -->

In my header, it just puts the code on my site. But before it prevented people from right clicking! I took it off for a sec to save a picture, and when I put it back on, it stopped working! Help!
 
 
Start new topic
Replies
lovescream
post Apr 19 2005, 05:40 PM
Post #2


define our lives for us.
********

Group: Staff Alumni
Posts: 11,656
Joined: Aug 2004
Member No: 43,293



That code looks.. wrong..
It just does.
Is your right-click code the type when somebody right-clicks, a pop=up comes up?
 
lpdrummer
post Apr 19 2005, 05:44 PM
Post #3


Senior Member
****

Group: Member
Posts: 137
Joined: Feb 2005
Member No: 103,647



QUOTE(Spiritedfreak @ Apr 19 2005, 6:40 PM)
That code looks.. wrong..
It just does.
Is your right-click code the type when somebody right-clicks, a pop=up comes up?

*


Yea, its a popup. It worked before, but whne I took it out and put it back in, it stopped working. I noticed the "-->" at the end, do I need something like that at the beginning?

QUOTE(bballbabiegrl @ Apr 19 2005, 6:43 PM)
try putting this code into your website stats:

CODE
<BODY ONCONTEXTMENU="return false">

*


But I need it to popup when someone clicks
 

Posts in this topic


Closed TopicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members: