Foros del Web » Programando para Internet » Javascript »

problemas con estilos y scripts entre navegador iexplorer y mozilla(firefox)

Estas en el tema de problemas con estilos y scripts entre navegador iexplorer y mozilla(firefox) en el foro de Javascript en Foros del Web. tengo problemas con cos estilos entre los navegadores iexplorer y mozilla(firefox) ya ke utilizo muchas cosas con estilos y si funcionan en ie, pero con ...
  #1 (permalink)  
Antiguo 31/08/2004, 16:50
 
Fecha de Ingreso: agosto-2004
Mensajes: 18
Antigüedad: 19 años, 8 meses
Puntos: 0
Pregunta problemas con estilos y scripts entre navegador iexplorer y mozilla(firefox)

tengo problemas con cos estilos entre los navegadores iexplorer y mozilla(firefox) ya ke utilizo muchas cosas con estilos y si funcionan en ie, pero con el otro no, incluso algo tan sencillo como
<script>
jardin.style.display='none';
<script>

no esconde al elemento jardin

como lo puedo sustituir por algo ke sea soportado por los dos navegadores, o como lo pongo.
gracias por su alluda,
  #2 (permalink)  
Antiguo 01/09/2004, 03:58
Avatar de caricatos
Moderador
 
Fecha de Ingreso: abril-2002
Ubicación: Torremolinos (Málaga)
Mensajes: 19.607
Antigüedad: 22 años
Puntos: 1284
Hola libido501, bienvenido a los foros :

Ese es un problema de fácil solución...

Supongo que jardin es un elemento con "id=jardin"
Si es así tienes que referenciarlo de la siguiente manera:
document.getElementById("jardin")... (luego .style.display = "none")
así:
document.getElementById("jardin").luego .style.display = "none";

Hay muchas formas de referenciar elementos, pero esa es una fundamental.

Saludos
__________________
Por favor:
No hagan preguntas de temas de foros en mensajes privados... no las respondo
  #3 (permalink)  
Antiguo 01/09/2004, 08:43
 
Fecha de Ingreso: agosto-2004
Mensajes: 18
Antigüedad: 19 años, 8 meses
Puntos: 0
gracias por tu ayuda caricatos, si funciono, pero fijate ke sigo teniendo algunos problemas con los estilos y el el navegador mozilla, incluso tengo un estilo igual al de aqui que cuando le das finalizar secion, se pone la pantalla gris, y me doy cuenta que aqui en forosdelweb, con mi navegador tampoco funciona, solo con el ie, como podria solucionar eso?,

gracias.
  #4 (permalink)  
Antiguo 01/09/2004, 09:03
Avatar de PatomaS
Colaborador
 
Fecha de Ingreso: marzo-2004
Ubicación: En alguna otra parte
Mensajes: 4.656
Antigüedad: 20 años, 1 mes
Puntos: 63
Hola

Ese efecto final del foro, parece ser un filtro solo para explorer, con lo que no podrás hacer algo similar para los demás, al menos no con pocos comandos.

Un detalle, con el tema del script, es mejor que pongas su inicio de esta manera:

<script type="text/JavaScript">

Es decir, indica que tipo de lenguaje estás usando.

Felicidad
__________________
¡ hey, hou, hou, hey !
  #5 (permalink)  
Antiguo 01/09/2004, 14:27
 
Fecha de Ingreso: agosto-2004
Mensajes: 18
Antigüedad: 19 años, 8 meses
Puntos: 0
gracias patomas, yo comunmente no le pongo el type, pero ya lo incluire,
aunke ya kale kon alguno, y no me lo korrijio algunos problemillas ke tengo, pero seguire intentando, ha y para todos, si funciono lo ke me dijo caricatos, pero de todos modos me deja movidas las cosas, esto no lo hace con ie.

gracias...
__________________
"el trabajo es el refujio de las personas ke no tienen nada ke hacer"
  #6 (permalink)  
Antiguo 05/09/2004, 03:40
Avatar de viciao2k3  
Fecha de Ingreso: julio-2004
Ubicación: Torroella de Montgri (Girona)
Mensajes: 16
Antigüedad: 19 años, 9 meses
Puntos: 0
a mi me pasa lo mismo con mi web en IE me va todo a la perfeccion pero con firefox u opera me fallan los scripts

dejo este codigo a ver si me ayudan a que sea compatible con firefox:

Código:
<script language="JavaScript" type="text/JavaScript">
<!--
function mostrarmenu2(obj) {
	var obj = document.getElementById(obj);
	var rightedge=document.body.scrollLeft+event.clientX - 77;
	var bottomedge=document.body.scrollTop+event.clientY + 9;
	if (obj.style.display =='') {
obj.style.display = 'none';
	}
	else {
obj.style.display='';
obj.style.left=rightedge;
obj.style.top=bottomedge
}
}
//-->
</script>
lo que hace el script es si el objeto es visible pues lo oculta o al reves, y lo muestra al lado de la posicion del cursor.

el objeto seria este:
Código:
 
<div id="Layer1" style="position:absolute; left:222px; top:12px; width:93px; height:57px; layer-background-color: #99FF66; z-index:1;DISPLAY: none"></div>
el link para hacer aparecer o desaparecer el objeto este:
Código:
<a href="#" onmouseover="mostrarmenu2('Layer1')" onmouseout="mostrarmenu2('Layer1')">LINK</a>
espero vuestra respuesta ya que aun uso IE por la web
__________________
Webmaster & Owner:

www.Viciao2k3.net

Blog World Cyber Games España

Última edición por viciao2k3; 05/09/2004 a las 03:42
  #7 (permalink)  
Antiguo 12/09/2004, 04:11
Avatar de viciao2k3  
Fecha de Ingreso: julio-2004
Ubicación: Torroella de Montgri (Girona)
Mensajes: 16
Antigüedad: 19 años, 9 meses
Puntos: 0
Por favor que alguien me responda
__________________
Webmaster & Owner:

www.Viciao2k3.net

Blog World Cyber Games España
  #8 (permalink)  
Antiguo 03/01/2005, 13:03
 
Fecha de Ingreso: octubre-2004
Mensajes: 7
Antigüedad: 19 años, 6 meses
Puntos: 0
Yo tengo un problema con mi menu javascript, tengo el menu sobre una intro flash y en IE me funciona sin problemas ... sin embargo en firefox el menu me aparece por debajo del flash.... pueden darme una mano por favor.

function Menu ( id, cssClass, cssOverClass) {
this.overCSS = cssOverClass;

this.id = Menu.register( this );

this.cell = document.getElementById( id );
this.cell.menuInst = this;
this.cell.onmouseover = Menu.forwardCellEvent;
this.cell.onmouseout = Menu.forwardCellEvent;

this.menu = document.createElement( "SPAN" );
document.body.appendChild( this.menu );
this.menu.style.position = "absolute";
this.menu.style.display = "none";
this.menu.style.zIndex = 20;

var table = document.createElement( "TABLE" );
this.menu.appendChild( table );
table.cellSpacing = 0;
table.cellPadding = 0;
table.className = cssClass;

this.tableBody = document.createElement( "TBODY" );
table.appendChild( this.tableBody );
}

Menu.prototype.hideTimeout = null;
Menu.prototype.shown = false;

Menu.prototype.addItem = function ( text, url ) {
var tr = document.createElement( "TR" );
this.tableBody.appendChild( tr );
var cell = document.createElement( "TD" );
tr.appendChild( cell );

cell.menuInst = this;
cell.url = url;
cell.innerHTML = "<img src='images/arrow.gif' width=14 height=9>" + text;
cell.style.borderBottom = "1px solid #999999";
cell.style.padding = "4 4 4 4";
cell.style.zIndex = 20;
cell.style.cursor = ns ? "pointer" : "hand";
cell.onmouseover = Menu.forwardItemEvent;
cell.onmouseout = Menu.forwardItemEvent;
cell.onclick = Menu.forwardItemEvent;
}

Menu.prototype.showMenu = function () {
var image = this.getImage();
image.src = this.getImageURL( "on" );

var topOffset = leftOffset = 0;
var curParent = this.cell;
while ( curParent ) {
topOffset += curParent.offsetTop;
leftOffset += curParent.offsetLeft;
curParent = curParent.offsetParent;
}

this.menu.style.top = topOffset + this.cell.offsetHeight;
this.menu.style.left = leftOffset;
this.menu.style.display = "block";

if ( !this.shown ) {
Menu.closeAll();
this.shown = true;
}
}

Menu.prototype.getImage = function () {
if ( this.cell.children ) return this.cell.children[ 0 ].children[ 0 ];
var child = this.cell.childNodes[ 1 ];
if ( child.childNodes[0].tagName == "IMG" ) return child.childNodes[ 0 ];
return child.childNodes[ 1 ];
}

Menu.prototype.getImageURL = function ( status ) {
var url = this.getImage().src;
return url.substr( 0, url.indexOf(this.cell.id) ) + this.cell.id + "-" + status + ".gif";
}

Menu.prototype.hideMenu = function () {
this.getImage().src = this.getImageURL( "off" );
this.menu.style.display = "none";
this.shown = false;
}

Menu.prototype.mouseoverCellHandler = function () {
this.cancelHide();
this.showMenu();
}

Menu.prototype.startHide = function () {
this.cancelHide();
this.hideTimeout = setTimeout( "Menu.insts[" + this.id + "].hideMenu()", 400 );
}

Menu.prototype.mouseoutCellHandler = Menu.prototype.startHide;

Menu.prototype.cancelHide = function () {
if ( this.hideTimeout ) clearTimeout( this.hideTimeout );
}

Menu.prototype.clickItemHandler = function ( cell ) {
document.location.href = cell.url;
}

Menu.prototype.mouseoverItemHandler = function ( cell ) {
this.cancelHide();
cell.className = this.overCSS;
}

Menu.prototype.mouseoutItemHandler = function ( cell ) {
cell.className = "";
this.startHide();
}

Menu.forwardCellEvent = function ( event ) {
Menu.forwardEvent( event, "Cell" );
}

Menu.forwardItemEvent = function ( event ) {
Menu.forwardEvent( event, "Item" );
}

Menu.forwardEvent = function ( event, type ) {
if ( !event ) event = window.event;
var curElement = event.srcElement || event.target;
while ( curElement && curElement.tagName != "TD" )
curElement = curElement.parentElement || curElement.parentNode;
if ( !curElement ) return;
curElement.menuInst[ event.type + type + "Handler" ]( curElement );
}

Menu.insts = [];

Menu.register = function ( inst ) {
var id = Menu.insts.length;
Menu.insts[ id ] = inst;
return id;
}

Menu.closeAll = function () {
for ( var i=0; i < Menu.insts.length; i++ ) {
var inst = Menu.insts[ i ];
if ( inst.shown ) inst.hideMenu();
}
}

Menu.unavailable = document.layers || ( navigator.platform == "MacPPC" && this.name == "Microsoft Internet Explorer" );

var ns = ( navigator.appName == "Netscape");
if ( ns ) {
HTMLElement.prototype.__defineGetter__(
"children",
function () {
var tmp = [];
var j = 0;
var n;
for ( var i = 0; i < this.childNodes.length; i++ ) {
n = this.childNodes[ i ];
if ( n.nodeType == 1 ) {
tmp[ j++ ] = n;
if ( n.name ) {
if ( !tmp[n.name] )
tmp[n.name] = [];
tmp[ n.name ][ tmp[n.name].length ] = n;
}
if ( n.id ) tmp[ n.id ] = n;
}
}
return tmp;
}
);
}
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 21:16.