DHTML - Menu DHTML

 
Vista:

Menu DHTML

Publicado por Daniela (1 intervención) el 09/03/2008 17:18:16
Hola tengo implementado un menu hace tiempo, y ahora noto que en Mozilla Firefox no funciona. Me podrian indicar que me esta faltando? (algo en la funcion para detectar el navegador en principio y no se si alguna mas)

Muchas gracias

El codigo es:

<script type="text/javascript">
<!--
// Objeto de deteccion del navegador
function DetectorNavegador() {
alert(this);
this.NS4 = document.layers;
this.IE4 = document.all;
this.DHTML = this.NS4 || this.IE4;
}

var soporta = new DetectorNavegador();
var menu = new Array();
var menuActivo = null;

// Objeto Menu
function activarMenu() {
if (soporta.DHTML && menuActivo != this) {
if (menuActivo) menuActivo.ocultar();
menuActivo = this;
this.mostrar();
}
}

function mostrarMenu() {
eval(this.capaRefStr + this.estiloRefStr + '.visibility = "visible"');
}

function ocultarMenu() {
eval(this.capaRefStr + this.estiloRefStr + '.visibility = "hidden"');
}

function cambiarPosicionMenu(top, left) {
if (soporta.DHTML) {
eval(this.capaRefStr + this.estiloRefStr + this.topRefStr + ' = top');
eval(this.capaRefStr + this.estiloRefStr + this.leftRefStr + ' = left');
}
}

function Menu(capaID, top, left) {
this.activar = activarMenu;
this.mostrar = mostrarMenu;
this.ocultar = ocultarMenu;
this.cambiarPosicion = cambiarPosicionMenu;
this.capaRefStr = (soporta.NS4) ?
'document["'+capaID+'"]' :
'document.all["'+capaID+'"]';
this.estiloRefStr = (soporta.NS4) ? '' : '.style';
this.topRefStr = (soporta.NS4) ? '.top' : '.pixelTop';
this.leftRefStr = (soporta.NS4) ? '.left' : '.pixelLeft';
this.cambiarPosicion(top, left);
}

// Manejo de eventos
function ocultarMenuActivo(e) {
if (menuActivo) {
menuActivo.ocultar();
menuActivo = null;
}
}

// Inicializacion
function inicializar() {
if (soporta.DHTML) {
if (soporta.NS4)
document.captureEvents(Event.MOUSEUP);
document.onmouseup = ocultarMenuActivo;
}
menu[1] = new Menu("submenu1", 42, 0);
menu[0] = new Menu("submenu0", 42, 396);
}

window.onload = inicializar;
//-->
</script>
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder