
05/11/2004, 07:47
|
 | | | Fecha de Ingreso: septiembre-2003 Ubicación: Pues leyéndote
Mensajes: 1.076
Antigüedad: 21 años, 6 meses Puntos: 59 | |
>> Menú contráctil de Tunait << Hola a tod@s l@s Forer@s.
Tengo tres frames: Arriba, izquierda y derecha.
Y el siguiente código del menú contráctil (arreglado un mis necesidades) de tunait:
Código:
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Menú contráctil - tunait.com</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script language="JavaScript" type="text/javascript">
/**************************************************************
Menú contráctil. Script creado por Tunait! (6/1/2004)
Si quieres usar este script en tu sitio eres libre de hacerlo con la condición de que permanezcan intactas estas
líneas, osea, los créditos.
No autorizo a publicar y ofrecer el código en sitios de script sin previa autorización
Si quieres publicarlo, por favor, contacta conmigo.
http://javascript.tunait.com/
[email protected]
****************************************************************/
var anchoMenu = 200 //anchura del menú
var secciones = 13 // cantidad de secciones principales
// var Menu_num = new Array('texto','enlace','target',link o padre(0 es link y + es cantidad de hijos))
//poner en null los valores que se quieran omitir
var Menu_0 = new Array('Cupón de la Once','http://www.once.es','Nueva',0) //opcion de menú principal
var Menu_1 = new Array('Loterias y
Apuestas','http://portal.minhac.es/Minhac/Temas/Loterias+y+Apuestas/LoteriaNacional/SeleccionLN.htm','Nuev
a',0) // 'Nueva' si se quiere en ventana nueva
var Menu_2 = new Array('Callejeros','http://mapas.viajar.com/viajes.jsp','Nueva',0)//null si se quiere cargar en
_self
var Menu_3 = new Array('El Tiempo','http://eltiempo.ya.com','Nueva',0)
var Menu_4 = new Array('El Tráfico','http://www.dgt.es/indices/dgtHtm_Portada_es.html','Nueva',0)
var Menu_5 = new Array('Guía Telefónica','http://blancas.paginasamarillas.es/home.html','Nueva',0)
var Menu_6 = new Array('Ferrocarriles','http://www.renfe.es','Nueva',0)
var Menu_7 = new Array('Correos y Telégrafos','http://www.correos.es','Nueva',0)
var Menu_8 = new Array('Iberia','http://www.iberia.es','Nueva',0)
var Menu_9 = new Array('Información de
Vuelos','http://www.aena.es/csee/Satellite?pagename=Herramientas/VTR/VuelosTiempoReal','Nueva',0)
var Menu_10 = new Array('Alerta AntiVirus','http://www.alerta-antivirus.es/','Nueva',0)
var Menu_11 = new Array('Cine','cine.html',null,null)
var Menu_12 = new Array('Sobre mí','sobremi.html',null,0)
/*************No tocar a partir de aquí*****************/
var sec
var iexTun=document.appName=='Microsoft Internet Explorer'?true:false;
if(iexTun){var cursorcillo='hand'}
else{var cursorcillo='pointer'}
function inicioMenu(){
with(document){
write('<div id="Menu">')
write('<table id="tablaMenu" cellspacing="1">')
}
for(m=0; m<secciones; m++){
with(document){
write('<tr><td class="secciones" id="menu_' + m +'">' )
write(eval('Menu_' + m + '[0]') + '</td>')
write('</tr>')
}
sec = eval('Menu_' + m)
document.getElementById('menu_' + m).onmouseover=function(){
this.className = 'seccionesHover'
}
document.getElementById('menu_' + m).onmouseout=function(){
this.className = 'secciones'
}
if(sec[3]>0){
document.getElementById('menu_' + m).onclick=function(){
abreMenu(this.id)
}
subMenu('Menu_' + m,sec[3],m)
}
else{
document.write('<tr><td class="cerrado"></td></tr>')
if(sec[1]!=null){
document.getElementById('menu_' + m).onclick=function(){
ir(this.id)
}
}
}
}
with(document){
write('</table>')
write('</div>')
}
}
function subMenu(n,cant,nm){
with(document){
write('<tr><td id="' + n + 'B" class="cerrado">')
write('<table class="subMeTabla" cellspacing="1">')
}
for(s=0; s<cant; s++){
subMe=eval(n+"_"+s)
with(document){
writeln('<tr><td style="cursor:'
+cursorcillo+'"onmouseover="this.className=\'subSeccionesHover\'"
onmouseout="this.className=\'subSecciones\'" class="subSecciones" onclick="ir(\'Menu_'+nm+'_'+s+'\')">' +
subMe[0] + '</td></tr>')
}
}
document.write('</table>')
document.write('</td></tr>')
}
function abreMenu(cual){
clase = cual
cual = cual.replace(/m/,"M")
cua = eval("'" + cual + "B'")
if(document.getElementById(cual+'B').className == 'abierto'){
document.getElementById(cual+'B').className = 'cerrado'
document.getElementById(clase).className = 'secciones'
document.getElementById(clase).onmouseout=function(){
this.className = 'secciones'
}
document.getElementById(clase).onmouseover=function(){
this.className = 'seccionesHover'
}
}
else{
document.getElementById(cual+'B').className = 'abierto'
document.getElementById(clase).className = 'seleccionado'
document.getElementById(clase).onmouseout=function(){
return false
}
document.getElementById(clase).onmouseover=function(){
return false
}
}
}
function ir(donde){
donde = eval(donde.replace(/m/,"M"))
if(donde[1] != null){
marco = donde[2]
if(marco == 'Nueva'){
window.open(donde[1])
}
else if(marco == null){
location.href=donde[1]
}
else{
eval('parent.' + marco + '.location.href="' + donde[1] + '"')
}}
}
/********** hasta aquí *************/
</script>
<style type="text/css">
.subMeTabla{ /*tabla de submenú*/
width: 100%;
font-family: Tahoma, Verdana, Arial;
font-size: 12px;
font-weight: bold;
text-align: center;
padding: 0;
}
.abierto{
width: 100%;
font-family: Tahoma, Verdana, Arial;
font-size: 12px;
font-weight: bold;
padding: 0;
}
.cerrado{/*no tocar*/
display: none;
height: 0;
padding:0;
}
#Menu{
width: 150px;
cursor: default;
}
#tablaMenu{ /*aspecto de la tabla del menú*/
width: 100%;
border: 0px solid #000000;
background-color: ##EEEEEE;
padding: 0;
}
.secciones{ /*aspecto de los botones principales*/
text-align: center;
background-color: #ADD8E6;
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-top-style: solid;
border-right-style: solid;
border-bottom-style: solid;
border-left-style: solid;
border-top-color: #6495ED;
border-right-color: #6495ED;
border-bottom-color: #6495ED;
border-left-color: #6495ED;
font-family: Tahoma, Verdana, Arial;
font-weight: normal;
font-size: 12px;
padding:2;
}
.seccionesHover{ /*aspecto de los botones principales al pasar el mouse*/
background-color: #FFFFFF;
color: #FF0000;
text-align: center;
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-top-style: solid;
border-right-style: solid;
border-bottom-style: solid;
border-left-style: solid;
border-top-color: #6495ED;
border-right-color: #6495ED;
border-bottom-color: #6495ED;
border-left-color: #6495ED;
font-family: Tahoma, Verdana, Arial;
font-weight: normal;
font-size: 12px;
padding:2;
}
.subSeccionesHover{ /*aspecto de los botones de las subsecciones al pasar el mouse*/
text-align: center;
background-color: #F0D2F0;
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-top-style: solid;
border-right-style: solid;
border-bottom-style: solid;
border-left-style: solid;
border-top-color: #000000;
border-right-color: #9900FF;
border-bottom-color: #9900FF;
border-left-color: #000000;
font-family: Tahoma, Verdana, Arial;
font-weight: bold;
font-size: 12px;
margin-bottom: 5px;
color: #990000;
}
.subSecciones{ /*aspecto de los botones de las subsecciones*/
text-align: center;
background-color: #D9C6EC;
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-top-style: solid;
border-right-style: solid;
border-bottom-style: solid;
border-left-style: solid;
border-top-color: #000000;
border-right-color: #9900FF;
border-bottom-color: #9900FF;
border-left-color: #000000;
font-family: Tahoma, Verdana, Arial;
font-weight: bold;
font-size: 12px;
margin-bottom: 5px;
color: #FFFFFF;
}
.seleccionado { /*aspecto del botón seleccionado*/
font-family: Tahoma, Verdana, Arial;
font-size: 12px;
font-weight: bold;
color: #FFFFFF;
background-color: #003399;
text-align: center;
border-top: 1px solid #FFFFFF;
border-right: 1px solid #333333;
border-bottom: 1px solid #333333;
border-left: 1px solid #FFFFFF;
}
</style>
</head>
<body>
<script>inicioMenu()</script>
</body>
</html>
¿Qué tengo que poner en la linea que está en ROJO, para que abra en el frame derecho, tal cómo muestro en esta imagen?
Muchas gracias adelantadas y un saludo a tod@s
Última edición por seoista; 05/11/2004 a las 07:50 |