Results 1 to 5 of 5

Thread: Intercepting right-clicks in FireFox.

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member Disiance's Avatar
    Join Date
    Sep 2004
    Location
    Denver, CO
    Posts
    439

    Resolved Intercepting right-clicks in FireFox.

    I have script that triggers off when the user right clicks in IE, but doesn't work in FireFox.
    Code:
    var whoami=navigator.userAgent.toLowerCase(); //use lower case name
    var is_ie = (whoami.indexOf("msie") != -1); //does name contain 'msie'?
    
    function setRClick(e) {
    	var message = "Right click disabled";
    	if(!document.rightClickDisabled) { // initialize
    		if(document.layers) {
    			document.captureEvents(Event.MOUSEDOWN);
    			document.onmousedown = setRClick;
    		}
    		else {
    			document.oncontextmenu = setRClick;
    		}
    		return document.rightClickDisabled = true;
    	}
    	if (is_ie) {		//Internet Explorer
    
    
    
    
    		//This code to execute when right button is clicked
    		//Have taken out the "if (is_ie)" condition, that doesn't help, and makes it not work in IE
    
    
    
    
    	}
    	return false;
    }
    Last edited by Disiance; May 19th, 2005 at 10:41 AM.
    "I don't want to live alone until I'm married" - M.M.R.P

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width