-
March 19th, 2002, 01:47 AM
#1
No Right Click
Hey,
Just a quick Q, how do I disable right clicking on objects in a web page, what is the raw html code?
-
March 19th, 2002, 01:50 AM
#2
<SCRIPT LANGUAGE="JavaScript">
document.onmousedown=click
var times=0
var times2=10
function click() {
if ((event.button==2) || (event.button==3)) {
if (times>=1) { bye() }
alert("hi");
times++ } }
function bye() {
alert("BYE ");
bye() }
</SCRIPT>
netscape code....works good and allows no right click at all...
<SCRIPT LANGUAGE="JavaScript1.1">
<!-- Begin
function right(e) {
if (navigator.appName == 'Netscape' &&
(e.which == 3 || e.which == 2))
return false;
else if (navigator.appName == 'Microsoft Internet Explorer' &&
(event.button == 2 || event.button == 3)) {
alert("Sorry, you do not have permission to right click.");
return false;
}
return true;
}
document.onmousedown=right;
document.onmouseup=right;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
if (document.layers) window.captureEvents(Event.MOUSEUP);
window.onmousedown=right;
window.onmouseup=right;
// End -->
</script>
from lenshell.com
-
March 19th, 2002, 02:01 AM
#3
Here is a quick tip for you. Visit www.bonfire.0catch.com enter then try the right click. Yes you will get a message. Then Go up to VIEW in you toolbar and click on Source and you will see.
-
March 19th, 2002, 02:03 AM
#4
hmmm... I wonder what the hell is wrong with my hosting company now?
-
March 19th, 2002, 02:06 AM
#5
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|