View previous topic :: View next topic |
Author |
Message |
Remi IK BEN NIEUW HIER!
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 Pofferdepofferdepof!
Joined: 20 Sep 2005 Posts: 435
|
Posted: Sat Oct 22, 2005 5:36 pm Post subject: |
|
|
Handig, zalk niki gebruike alsk mijne website ga make |
|
Back to top |
|
|
TheFreak4Ever Post hier elke dag
Joined: 19 Sep 2005 Posts: 360
|
Posted: Sat Oct 22, 2005 9:01 pm Post subject: |
|
|
En wa als ge ne Apple hebt
Daar is ma 1 Knopje aan.
En bij mijn wete kan FireFox dit script niet gebruike. e lekske in u "beveiliging"
Ma voor de rest leuk idee _________________
www.timb.be |
|
Back to top |
|
|
TheFreak4Ever Post hier elke dag
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>
|
_________________
www.timb.be |
|
Back to top |
|
|
pofferd Pofferdepofferdepof!
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.? |
|
Back to top |
|
|
TheFreak4Ever Post hier elke dag
Joined: 19 Sep 2005 Posts: 360
|
|
Back to top |
|
|
|