AllesPC Forum Index AllesPC
Site hosted by: www.youhosting.be
 

Right click disabler
Click here to go to the original topic

 
       AllesPC Forum Index -> Website
View previous topic :: View next topic  
Author Message
Remi



Joined: 20 Sep 2005
Posts: 0
Location: Halle

Posted: Sun Sep 25, 2005 11:59 am    Post subject: Right click disabler  

om uwe right click te disabele op een website:
zet het tussen de head tags

Code: <script language="JavaScript1.2" type="text/javascript">
if (window.Event) document.captureEvents(Event.MOUSEUP);
function nocontextmenu(){
event.cancelBubble = true;
event.returnValue = false;
return false;
}
function norightclick(e){
if (window.Event){
 if (e.which == 2 || e.which == 3);
 return false;
}
else if (event.button == 2 || event.button == 3){
 event.cancelBubble = true;
 event.returnValue = false;
 return false;
}
}
document.oncontextmenu = nocontextmenu;
document.onmousedown = norightclick;
</script>
Back to top  
pofferd



Joined: 20 Sep 2005
Posts: 435

Posted: Sat Oct 22, 2005 5:36 pm    Post subject:  

Handig, zalk niki gebruike :lol: alsk mijne website ga make :wink:
Back to top  
TheFreak4Ever



Joined: 19 Sep 2005
Posts: 360

Posted: Sat Oct 22, 2005 9:01 pm    Post subject:  

En wa als ge ne Apple hebt :D
Daar is ma 1 Knopje aan.
En bij mijn wete kan FireFox dit script niet gebruike. e lekske in u "beveiliging" :D
Ma voor de rest leuk idee :D
Back to top  
TheFreak4Ever



Joined: 19 Sep 2005
Posts: 360

Posted: Sat Oct 22, 2005 9:13 pm    Post subject:  

Ng iet leuker, om een zelf gemaakt menuke te tonen als ge op de rechter muisknop klikt. Ge kunt er alles zelf in aan passen.

Stap 1. Plaats dit in de HEAD
Code: <style>
<!--
.skin0 {
position:absolute;
text-align:left;
width:200px;
border:2px solid black;
background-color:menu;
font-family:Verdana;
line-height:20px;
cursor:default;
visibility:hidden;
}
.skin1 {
cursor:default;
font:menutext;
position:absolute;
text-align:left;
font-family: Arial, Helvetica, sans-serif;
font-size: 10pt;
width:120px;
background-color:menu;
border:1 solid buttonface;
visibility:hidden;
border:2 outset buttonhighlight;
}
.menuitems {
padding-left:5px;
padding-right:10px;
}
-->
</style>

<SCRIPT LANGUAGE="JavaScript1.2">

<!-- Begin
var menuskin = "skin1"; // skin0, or skin1
var display_url = 0; // Show URLs in status bar?
function showmenuie5() {
var rightedge = document.body.clientWidth-event.clientX;
var bottomedge = document.body.clientHeight-event.clientY;
if (rightedge < ie5menu.offsetWidth)
ie5menu.style.left = document.body.scrollLeft + event.clientX - ie5menu.offsetWidth;
else
ie5menu.style.left = document.body.scrollLeft + event.clientX;
if (bottomedge < ie5menu.offsetHeight)
ie5menu.style.top = document.body.scrollTop + event.clientY - ie5menu.offsetHeight;
else
ie5menu.style.top = document.body.scrollTop + event.clientY;
ie5menu.style.visibility = "visible";
return false;
}
function hidemenuie5() {
ie5menu.style.visibility = "hidden";
}
function highlightie5() {
if (event.srcElement.className == "menuitems") {
event.srcElement.style.backgroundColor = "highlight";
event.srcElement.style.color = "white";
if (display_url)
window.status = event.srcElement.url;
   }
}
function lowlightie5() {
if (event.srcElement.className == "menuitems") {
event.srcElement.style.backgroundColor = "";
event.srcElement.style.color = "black";
window.status = "";
   }
}
function jumptoie5() {
if (event.srcElement.className == "menuitems") {
if (event.srcElement.getAttribute("target") != null)
window.open(event.srcElement.url, event.srcElement.getAttribute("target"));
else
window.location = event.srcElement.url;
   }
}
//  End -->
</script>


Stap 2 Plaats dit onder de BODY-tag (item 1 enzo moogde andere namen en linken geven. Ge moogt er ook toevoegen)

Code:
<div id="ie5menu" class="skin0" onMouseover="highlightie5()" onMouseout="lowlightie5()" onClick="jumptoie5();">
<div class="menuitems" url="http://www.allespc.tk">Item 1</div>
<div class="menuitems" url="http://www.allespc.tk">Item 2</div>
<div class="menuitems" url="http://www.allespc.tk">Item 3</div>
<div class="menuitems" url="http://www.allespc.tk">Item 4</div>
<div class="menuitems" url="http://www.allespc.tk">Item 5</div>
</div>
<script language="JavaScript1.2">
if (document.all && window.print) {
ie5menu.className = menuskin;
document.oncontextmenu = showmenuie5;
document.body.onclick = hidemenuie5;
}
</script>
Back to top  
pofferd



Joined: 20 Sep 2005
Posts: 435

Posted: Sat Oct 22, 2005 9:33 pm    Post subject:  

en wa voor effect geeft da dan
ejje soms geen voorbeeld daarvan.? :roll:
Back to top  
TheFreak4Ever



Joined: 19 Sep 2005
Posts: 360

Posted: Sat Oct 22, 2005 9:45 pm    Post subject:  

e voorbeeldje
http://html_help4u.tripod.com/rc_menu.html
Back to top  
 
       AllesPC Forum Index -> Website
Page 1 of 1


Powered by phpBB Search Engine Indexer
Powered by phpBB 2.0.22 © 2001, 2002 phpBB Group