pruevas
-
-
-
-
-
-
-
-
-
-
- var lista_menus = new Array (
- "Menu1",
- "Menu2",
- "Menu3"
- )
-
-
-
-
-
-
-
- var datos_menu1 = new Array (
-
- "http:⁄⁄www.elcodigo.com", "Inicio ",
- "javascript:LanzaMenu('Menu2', 1);", "Taller > ",
- "http:⁄⁄www.elcodigo.com⁄tutoriales⁄tutoriales.html", "Tutoriales " ⁄⁄OJO, el ultimo no lleva coma
- )
-
-
-
- var datos_menu2 = new Array (
- "http:⁄⁄www.elcodigo.com⁄taller⁄javascript⁄indices.html", "JavaScript ",
- "http:⁄⁄www.elcodigo.com⁄taller⁄dhtml⁄indices.html", "DHTML ",
- "javascript:LanzaMenu('Menu3', 1);", "Otros lenguajes > "
- )
-
-
-
- var datos_menu3 = new Array (
- "http:⁄⁄www.elcodigo.com⁄taller⁄perl⁄indices.html", "PERL ",
- "http:⁄⁄www.elcodigo.com⁄taller⁄html⁄indices.html", "CSS y HTML " ⁄⁄OJO, el ultimo no lleva coma
- )
-
-
-
-
- var xpos = 0
- var ypos = 0
- var TemporizadorDestino = null
- var origen = -1
- var destino = -1
-
-
-
-
-
-
- function ClickRaton(e){
-
-
-
- if (!e) var e = window.event
-
- if (e.pageX || e.pageY) {
- xpos = e.pageX + 'px'
- ypos = e.pageY + 'px'
- } else if (e.clientX || e.clientY) {
- xpos = e.clientX + document.body.scrollLeft + 'px'
- ypos = e.clientY + document.body.scrollTop + 'px'
- }
-
- return true
- }
-
-
-
-
-
- function PosicionaMenu( nombre_menu ) {
- if (document.getElementById) {
- document.getElementById(nombre_menu).style.left = xpos
- document.getElementById(nombre_menu).style.top = ypos
- } else if (document.all) {
- document.all[nombre_menu].style.pixelLeft = xpos
- document.all[nombre_menu].style.pixelTop = ypos
- }
- }
-
-
-
-
-
-
- function LanzaMenu(nombre_menu, on) {
-
- PosicionaMenu(nombre_menu)
-
- if (on){
- if (document.getElementById) {
- document.getElementById(nombre_menu).style.visibility = "visible"
- } else if (document.all) {
- document.all[nombre_menu].style.visibility = "visible"
- }
-
- } else {
- if (document.getElementById) {
- document.getElementById(nombre_menu).style.visibility = "hidden"
- } else if (document.all) {
- document.all[nombre_menu].style.visibility = "hidden"
- }
- }
- }
-
-
-
- function MarcaOrigen( menu ) {
- if (TemporizadorDestino)
- clearTimeout(TemporizadorDestino)
-
- origen = menu
- destino = -1
- TemporizadorDestino = setTimeout('CompruebaDestino()', 250)
-
- }
-
-
-
- function MarcaDestino( menu ) {
- destino = menu
- }
-
-
-
- function CompruebaDestino( menu ) {
- if ( destino == -1 ) {
- Ocultar( 0 )
- } else if ( destino < origen ) {
- Ocultar( destino )
- } else if ( destino == origen ) {
- Ocultar( destino )
- }
- }
-
-
- function Ocultar( menuID ) {
-
- for (contador = menuID; contador < lista_menus.length; contador++) {
- eval("LanzaMenu('" + lista_menus[contador] + "', 0)")
- }
- }
-
-
-
-
-
- function EscribeMenu( nombre_menu, numero_menu, datos_menu ) {
- var espacio = ⁄ ⁄gi;
- var mayorque = ⁄>⁄gi;
- var literal;
- var cadena_menu = '
+ nombre_menu + '" onMouseOut="MarcaOrigen(' + numero_menu + ');" OnMouseOver="MarcaDestino(' + numero_menu + ');">
- for( contador = 0; contador < datos_menu.length; contador = contador + 2 ) {
- literal = new String( datos_menu[contador+1] )
- datos_menu[contador+1] = literal.replace(espacio, " ")
- literal = new String( datos_menu[contador+1] )
- datos_menu[contador+1] = literal.replace(mayorque, ">")
- cadena_menu += ' + datos_menu[contador] + '">' + datos_menu[contador+1] + '<⁄a><⁄td><⁄tr>\n'
- }
- cadena_menu += '<⁄table><⁄div>\n'
-
- document.write(cadena_menu)
- }
-
-
-
-
-
-
- document.onclick = ClickRaton
-
-
-
- <⁄script>
-
-
-
-
-
-
-
-
-
-
-
- .TabMenu {
- padding: 0px;
- background-color: #D4D0C8;
- vertical-align: top;
- border-style: solid;
- border-width: 1px;
- border-bottom-color: #000000;
- border-right-color: #000000;
- border-left-color: #808080;
- border-top-color: #808080;
- text-align: left;
- }
-
- .SubMenu {
- position: absolute;
- top: 0px;
- left: 0px;
- z-index: 1;
- visibility: hidden;
- }
-
- a.MenuItem {font-size: 0.8em; padding: 2px; font-family: Courier, Arial, Serif; text-decoration: none;}
- a.MenuItem:link {color: #000000; }
- a.MenuItem:hover {color: #FFFFFF; background: #0A246A;}
- a.MenuItem:visited {color: #868686;}
-
-
-
- <⁄style>
- <p>El siguiente enlace abre un ejemplo del menú contextual, que tiene 2 submenús.<⁄p>
-
-
- <script type="text⁄javascript" language="javascript">
- EscribeMenu( "Menu1", 1, datos_menu1 );
- EscribeMenu( "Menu2", 2, datos_menu2 );
- EscribeMenu( "Menu3", 3, datos_menu3 );
- <⁄script>
-
-
- <p><a href="javascript:LanzaMenu('Menu1', 1);">Menú de ejemplo<⁄a><⁄p>
-
- <⁄body>
- <⁄html>