Difference between revisions of "MediaWiki:Middleclick.js"

From Tycoon Gaming
(Created page with "$(document).mousedown(function(e){ if(e.which === 2 ){ alert("middle click"); return false; // Or e.preventDefault() } });")
 
Line 1: Line 1:
 
$(document).mousedown(function(e){
 
$(document).mousedown(function(e){
    if(e.which === 2 ){
+
if ( window.location !== window.parent.location ) {
      alert("middle click");   
+
if(e.which === 2 ){
      return false; // Or e.preventDefault()
+
return false; // Or e.preventDefault()
    }
+
}
 +
}
 
});
 
});

Revision as of 19:22, 12 October 2019

$(document).mousedown(function(e){
	if ( window.location !== window.parent.location ) { 
		if(e.which === 2 ){
			return false; // Or e.preventDefault()
		}
	}
});