| ||||
| Re: desabilitar boton derecho, y sacar otro menu
Código:
suerte <html>
<head>
<style>
.menuItem {
font-family:sans-serif; font-size:12pt;
width:220;padding-left:20;
background-color:menu;
color:black
}
.highlightItem {
font-family:sans-serif; font-size:12pt;
width:220; padding-left:20;
background-Color:highlight; color:white;
}
</style>
</head>
<body oncontextmenu="showMenu(); return false">
<h2>Right Click to Bring Up a Context Menu</h2>
<!-- Context Menu -->
<div id=menu1
onclick="clickMenu()"
onmouseover="toggleMenu()"
onmouseout="toggleMenu()"
style="position:absolute;
display:none;
border: 2px outset black;
width:220;
background-color:menu">
<div class="menuItem"
doFunction="alert(el.innerHTML);">Graph</div>
<hr>
<div class="menuItem"
doFunction="alert(el.innerHTML);">
Show News
</div>
<div class="menuItem"
doFunction="alert(el.innerHTML);">Buy
</div>
<hr>
<div class="menuItem"
doFunction="alert(el.innerHTML);">Sell
</div>
<div class="menuItem"
doFunction="alert(el.innerHTML);">
Refresh Portfolio
</div>
</div>
<!-- End of Context Menu -->
<script>
var el;
function showMenu() {
ContextElement=event.srcElement;
menu1.style.leftPos+=10;
menu1.style.posLeft=event.clientX;
menu1.style.posTop=event.clientY;
menu1.style.display="";
menu1.setCapture();
}
function toggleMenu() {
el=event.srcElement;
if (el.className=="menuItem") {
el.className="highlightItem";
} else if (el.className=="highlightItem") {
el.className="menuItem";
}
}
function clickMenu() {
menu1.releaseCapture();
menu1.style.display="none";
el=event.srcElement;
if (el.doFunction != null) {
eval(el.doFunction);
}
}
</script>
</body>
</html>
|
| |||
| Re: desabilitar boton derecho, y sacar otro menu Yo se como deshabilitar el boton derecho del mouse :P, pero no como crear un menu hecho por ti. Si te sirve, aqui te dejo el codigo para el boton. <script language="JavaScript1.1"> <!-- Begin function right(e) { var msg = " [ No me copies ] "; if (navigator.appName == 'Netscape' && e.which == 3) { alert(msg); // Delete this line to disable but not alert user return false; } else if (navigator.appName == 'Microsoft Internet Explorer' && event.button==2) { alert(msg); // Delete this line to disable but not alert user return false; } return true; } document.onmousedown = right; // End --> </script> :cantar: Suerte! ;) |
| ||||
| Re: desabilitar boton derecho, y sacar otro menu Me cae que muchas gracias ... algo asi he estado buscando , y esta bastante bien , solo que el que tenia y perdi ... en el menu .. te creabas tu propío menu y las opciones eran links .. pero este esta bastante bien y y la verdad que que chido por ese wey que me contesto ... y esta muy bueno el foro ... bueno nos vemos ... y al rato paso , haber si .. ya hay por ahi otro scrip como el que pido ... |
| ||||
| Re: desabilitar boton derecho, y sacar otro menu hayyyy se me olvidaba ... hay por ahi un scrip que cierre ventanas Pop-up pero por tiempo ? y no sea manual , mas bien automatizado , por ejemplo ... a los 20 segundos se cierre... pero solo esa ventana .. no el navegador de pa pagina .. |