AllesPC Forum Index AllesPC
Site hosted by: www.youhosting.be
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Right click disabler

 
Post new topic   Reply to topic    AllesPC Forum Index -> Website
View previous topic :: View next topic  
Author Message
Remi
IK BEN NIEUW HIER!


Joined: 20 Sep 2005
Posts: 0
Location: Halle

PostPosted: Sun Sep 25, 2005 11:59 am    Post subject: Right click disabler Reply with quote

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
View user's profile Send private message MSN Messenger
pofferd
Pofferdepofferdepof!


Joined: 20 Sep 2005
Posts: 435

PostPosted: Sat Oct 22, 2005 5:36 pm    Post subject: Reply with quote

Handig, zalk niki gebruike Laughing alsk mijne website ga make Wink
Back to top
View user's profile Send private message
TheFreak4Ever
Post hier elke dag


Joined: 19 Sep 2005
Posts: 360

PostPosted: Sat Oct 22, 2005 9:01 pm    Post subject: Reply with quote

En wa als ge ne Apple hebt Very Happy
Daar is ma 1 Knopje aan.
En bij mijn wete kan FireFox dit script niet gebruike. e lekske in u "beveiliging" Very Happy
Ma voor de rest leuk idee Very Happy
_________________

www.timb.be
Back to top
View user's profile Send private message Send e-mail Visit poster's website
TheFreak4Ever
Post hier elke dag


Joined: 19 Sep 2005
Posts: 360

PostPosted: Sat Oct 22, 2005 9:13 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
pofferd
Pofferdepofferdepof!


Joined: 20 Sep 2005
Posts: 435

PostPosted: Sat Oct 22, 2005 9:33 pm    Post subject: Reply with quote

en wa voor effect geeft da dan
ejje soms geen voorbeeld daarvan.? Rolling Eyes
Back to top
View user's profile Send private message
TheFreak4Ever
Post hier elke dag


Joined: 19 Sep 2005
Posts: 360

PostPosted: Sat Oct 22, 2005 9:45 pm    Post subject: Reply with quote

e voorbeeldje
http://html_help4u.tripod.com/rc_menu.html
_________________

www.timb.be
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    AllesPC Forum Index -> Website All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Archive

    futureweb.be .:. jouw hosting en webdesign partner