• Viernes 17 de Mayo de 2024, 05:40

Mostrar Mensajes

Esta sección te permite ver todos los posts escritos por este usuario. Ten en cuenta que sólo puedes ver los posts escritos en zonas a las que tienes acceso en este momento.


Temas - EGunther

Páginas: [1]
1
JavaScript / Sintaxis Javascript En Firefox
« en: Martes 5 de Febrero de 2008, 13:48 »
Estimados ya no se que hacer ni cual es el problema. al parecer mi sintaxis no es soportada por firefox o algo esta mal en mi codigo. Esto es un script que corre en una master.page, estoy desarrollando una aplicacion con csharp, pero estoy estancado con la sintaxis de javascript en firefox, he leido y buscado que lo correcto en firefox es usar:

window.document.getElementById('tab_about').style.height = 0;

Pero creo que algo estoy haciendo mal. Por favor me podrian ayudar y darme una mano?


function(s, e) {

var browserName=navigator.appName;
if (browserName=='Microsoft Internet Explorer')
{
alto_menu = GetHeight(window.document.getElementById('ctl00_ASPxNavBar1'));
alto_tdmenu = GetHeight(window.document.getElementById('td_menu'));

a1 = GetHeight(window.document.getElementById('ctl00_ASPxNavBar1_GHC0'));
a2 = GetHeight(window.document.getElementById('ctl00_ASPxNavBar1_GHC1'));
a3 = GetHeight(window.document.getElementById('ctl00_ASPxNavBar1_GHC2'));
a4 = GetHeight(window.document.getElementById('ctl00_ASPxNavBar1_GHC4'));
a5 = GetHeight(window.document.getElementById('ctl00_ASPxNavBar1_GHC5'));

window.document.getElementById('div_sir').style.height = 0;
window.document.getElementById('div_sgi').style.height = 0;
window.document.getElementById('div_sic').style.height = 0;
window.document.getElementById('div_rsf').style.height = 0;
window.document.getElementById('div_adm').style.height = 0;
window.document.getElementById('tab_about').style.height = 0;

window.document.getElementById('div_sir').style.height = alto_tdmenu - 160;
window.document.getElementById('div_sgi').style.height = alto_tdmenu - 160;
window.document.getElementById('div_sic').style.height = alto_tdmenu - 160;
window.document.getElementById('div_rsf').style.height = alto_tdmenu - 160;
window.document.getElementById('div_adm').style.height = alto_tdmenu - 160;
window.document.getElementById('tab_about').style.height = alto_tdmenu - 160;

window.document.getElementById('div_sir').style.width = 205;
window.document.getElementById('div_sgi').style.width = 205;
window.document.getElementById('div_sic').style.width = 205;
window.document.getElementById('div_rsf').style.width = 205;
window.document.getElementById('div_adm').style.width = 205;
window.document.getElementById('tab_about').style.width= 205;
}
else
{
alto_menu = GetHeight(window.document.getElementById('ctl00_ASPxNavBar1'));
alto_tdmenu = GetHeight(window.document.getElementById('td_menu'));

a1 = GetHeight(window.document.getElementById('ctl00_ASPxNavBar1_GHC0'));
a2 = GetHeight(window.document.getElementById('ctl00_ASPxNavBar1_GHC1'));
a3 = GetHeight(window.document.getElementById('ctl00_ASPxNavBar1_GHC2'));
a4 = GetHeight(window.document.getElementById('ctl00_ASPxNavBar1_GHC4'));
a5 = GetHeight(window.document.getElementById('ctl00_ASPxNavBar1_GHC5'));

window.document.getElementById('div_sir').style.height = 0;
window.document.getElementById('div_sgi').style.height = 0;
window.document.getElementById('div_sic').style.height = 0;
window.document.getElementById('div_rsf').style.height = 0;
window.document.getElementById('div_adm').style.height = 0;
window.document.getElementById('tab_about').style.height = 0;

window.document.getElementById('div_sir').style.height = alto_tdmenu - 160;
window.document.getElementById('div_sgi').style.height = alto_tdmenu - 160;
window.document.getElementById('div_sic').style.height = alto_tdmenu - 160;
window.document.getElementById('div_rsf').style.height = alto_tdmenu - 160;
window.document.getElementById('div_adm').style.height = alto_tdmenu - 160;
window.document.getElementById('tab_about').style.height = alto_tdmenu - 160;

window.document.getElementById('div_sir').style.width = 205;
window.document.getElementById('div_sgi').style.width = 205;
window.document.getElementById('div_sic').style.width = 205;
window.document.getElementById('div_rsf').style.width = 205;
window.document.getElementById('div_adm').style.width = 205;
window.document.getElementById('tab_about').style.width = 205;
}

Se supone que dentro del else estaria la condicion de firefox u otro navegador, se que estoy generalizando mucho pero quiero probar con firefox, finalmente deje igual ambos casos tanto para Iexplorer como para firefox para que me puedan ayudar que cambiar, para IExplorer funciona perfecto.

Esto es parte de un control de menu vertical que se expande. El cual tiene 6 secciones "div_sir", "div_sgi", "div_sic","div_rsf","div_adm","tab_about"

Les agradezco de antemano por vuestro tiempo!

Páginas: [1]