Ver Mensaje Individual
  #1 (permalink)  
Antiguo 29/06/2008, 03:42
Avatar de mauricioadrian
mauricioadrian
 
Fecha de Ingreso: junio-2008
Mensajes: 157
Antigüedad: 15 años, 11 meses
Puntos: 0
quitar el rebote.

hola tengo un pequeño script en el que tengo un tabstrib, o pestañas. para mostrar diferentes datos. el problema es que cuando cambio de pestaña esta hace que me lleve a lo mas alto de la web. rebota hacia arriba, existe alguna forma de evitar esto? eh visto que los tabs de otras web no causan este efecto malo.

aca va el script

<style type="text/css">

.menu {
background-image: url(pestanias/fondo_solapa_off.jpg); height: 25px; width: 420px; height:23px; font:11px Arial, Helvetica, sans-serif; margin-bottom: 10px; border-right: black 1px solid; border-left: black 1px solid; border-bottom: white 1px solid;
}

.menu ul {
margin:0px; padding:0px; list-style:none; text-align:left;
}
.menu li {
display:inline; line-height:23px;
}
.menu li a {
text-decoration:none; padding:4px 5px 6px 5px; color:#16387C; background: url(fondo_solapa_off.jpg); height: 25px; background-repeat: repeat;
}
.menu li a.tabactive {
font-weight:bold; color:#CC6633; background-image: url(pestanias/fondo_solapa_on.jpg); background-repeat: repeat; height: 25px ; border-top: black 1px solid; border-right: black 1px solid; border-left: black 1px solid;
}

</style>


<script type="text/javascript">
/* Función importante para la mezcla fichas de entrada y salida */
function ocultar_pestania(idname){
document.getElementById(idname).style.display = 'none';
}
function mostrar_pestania(idname){
document.getElementById(idname).style.display = 'block';
}
</script>


<script type="text/javascript">
/*className sobre escribe una clase, dejando solo la ultima aplicada.*/
function tab_activo(tab) {
if (tab=='1'){
document.getElementById('id_tab_uno').className='t ab1 tabactive';
document.getElementById('id_tab_dos').className='t ab2';
document.getElementById('id_tab_tres').className=' tab3';
}else if (tab=='2'){
document.getElementById('id_tab_uno').className='t ab1';
document.getElementById('id_tab_dos').className='t ab2 tabactive';
document.getElementById('id_tab_tres').className=' tab3';
}else if (tab=='3'){
document.getElementById('id_tab_uno').className='t ab1';
document.getElementById('id_tab_dos').className='t ab2';
document.getElementById('id_tab_tres').className=' tab3 tabactive';
}
}
</script>

</head>
<body bgcolor="white">

<table width="250" border="0" align="center" cellpadding="0" cellspacing="0">

<tr>
<td height="5">
</td>
</tr>
<tr>
<td valign="top" class="menu">
<div class="menu" >
<ul>
<li><a href="#" onclick="mostrar_pestania('id_contenido_uno'); ocultar_pestania('id_contenido_dos');tab_activo('2 '); ocultar_pestania('id_contenido_tres');" onclick="return false;" title="Pronóstico para Gral. Villegas." class="tabactive" id="id_tab_dos">Pronóstico para Gral. Villegas. </a></li>

<li><a href="#" onclick="mostrar_pestania('id_contenido_dos'); ocultar_pestania('id_contenido_tres'); tab_activo('1'); ocultar_pestania('id_contenido_uno');" onclick="return false;" title="Ultimas Noticias" class="tabactive" id="id_tab_uno">Ultimas Noticias. </a>
</li>

<li><a href="#" onclick="mostrar_pestania('id_contenido_tres'); ocultar_pestania('id_contenido_uno'); ocultar_pestania('id_contenido_dos'); tab_activo('3');" onclick="return false;" title="Noticias Destacadas" class="tabactive" id="id_tab_tres">Noticias Destacadas. </a></li>

</ul>
</div>
</td>
</tr>
</table>

aca dejo el link mejor sino http://www.villegasaldia.com.ar/index.php