Foros del Web » Creando para Internet » Diseño web »

Problema Firefox

Estas en el tema de Problema Firefox en el foro de Diseño web en Foros del Web. Buenas a todos! soy nueva en la web, pero llevo leyendo vuestras faqs un tiempo ;) , escribo xk no soy capaz d dar cn ...
  #1 (permalink)  
Antiguo 17/01/2008, 19:38
 
Fecha de Ingreso: enero-2008
Mensajes: 2
Antigüedad: 16 años, 3 meses
Puntos: 0
Pregunta Problema Firefox

Buenas a todos! soy nueva en la web, pero llevo leyendo vuestras faqs un tiempo ;) , escribo xk no soy capaz d dar cn la solucion y estoy desesperada. buen, pues resulta que m funciona perfectamnt en explorer pero en firefox no...he intentado de muxas formas y no doy con el fallo, espero k m ayudeis. el codigo es muy extenso, solo os dejo el javascript, el html si m lo pedis tmb lo pongos.
muxas gracias.
un saludo.

Código:
<style type="text/css">
		
		
		.tras
		{
			background-color:transparent;
			cursor:pointer;
			position:absolute;
			left:-52px;
			top:-34px;
			height:17px;
			width:2px;
		}
		
		.trasp
		{
			background-color:transparent;
			border-color:transparent;
			cursor:pointer;
		}	
		
		.traspa
		{
			background-color:transparent;
			border-color:transparent;
			position:absolute;
			left:155px;
			top:70px;
		}
		
		.trasfirefox
		{
			background-color:transparent;
			cursor:pointer;
			position:absolute;
			margin-left:-73%;
			margin-top:-34px;
			height:17px; 
		}
		
	</style>
	
	<SCRIPT type=text/javascript>

	function setOpacity(obj, opacity) 
	{
	  opacity = (opacity == 100)?99.999:opacity;
	  // IE/Win
  	  document.getElementById(obj).style.filter = "alpha(opacity:"+opacity+")";

	  // Safari<1.2, Konqueror
	  document.getElementById(obj).style.KHTMLOpacity = opacity/100;

	  // Older Mozilla and Firefox
	  document.getElementById(obj).style.MozOpacity = opacity/100;

	  // Safari 1.2, newer Firefox and Mozilla, CSS3
	  document.getElementById(obj).style.opacity = opacity/100;
	}
		
	function comprobarcss()
	{
		if(navigator.appName=="Microsoft Internet Explorer")
		{
			document.getElementById('exam').className="tras";
		}
		else
		{
			document.getElementById('exam').className="trasfirefox";
			document.getElementById('reproductor').style.top="105px";
			document.getElementById('reproductor').style.left="70px";
		}
		
	}	
	
	function play(song)
	{
        var yo=document.getElementById('reprod');
		if(yo.playstate==2)
		{ 
			yo.controls.play();
		}
		else
		{
			if(song!=null)
			{
				var l=document.getElementById(song).parentNode.id;
				yo.URL=song;
				yo.controls.play();
				fondo('palevioletred',l);
				for(var i=1;i<=document.getElementById('listareprd').lastChild.id;i++)
				{
					if(document.getElementById(i)!=null)
					{
						fondo('transparent',i);
					}
				}
				fondo('palevioletred',l);
				
			}
			else
			{
				document.getElementById('reprod').controls.play();
				var puntero=document.getElementById('listareprd');
				if (puntero.childNodes.length<2) 
				{
					alert('No hay ningún medio para reproducir');
				}
			}
		}	
		tiempo();
	}
	
	function stop(nombre)
	{
		document.getElementById(nombre).controls.stop();
	}
	
	function pause(nombre)
	{
		if(document.getElementById(nombre).playstate==2)
		{ 
			document.getElementById(nombre).controls.play();
		}
		else
		{ 
			document.getElementById(nombre).controls.pause();
		}
	} 
	
	function rew(nombre)
	{
		document.getElementById(nombre).controls.fastReverse();	
	}	
	
	function pos(nombre)
	{
		document.getElementById(nombre).controls.fastForward();
	}
	
	function subVol(nombre)
	{
		y=document.getElementById(nombre).settings.volume;
		document.getElementById(nombre).settings.volume=y+10;
	}
	
	function bajVol(nombre)
	{
		y=document.getElementById(nombre).settings.volume;
		document.getElementById(nombre).settings.volume=y-10;
	}
	
	function rep(nombre)
	{	
		document.getElementById(nombre).settings.PlayCount=999;
	}	
	
	function mute(nombre)
	{
		document.getElementById(nombre).settings.mute = true;
	}
	
	function sonido(nombre)
	{
		document.getElementById(nombre).settings.mute =false;
	}
		
	function balLeft(nombre)
	{
		z=document.getElementById(nombre).settings.balance;
		document.getElementById(nombre).settings.balance = z-50;
	}
	
	function balRight(nombre)
	{
		z=document.getElementById(nombre).settings.balance;
		document.getElementById(nombre).settings.balance = z+50;
	}
	
	function balCenter(nombre)
	{
		document.getElementById(nombre).settings.balance=0;
	}
		
	function precargar(imagen,origen,mapa) 
	{
		eval(imagen+' = new Image()')
		eval(imagen+'.src = "'+origen+'"')
		eval(imagen+'.useMap = "'+mapa+'"')
	}

	
	function CambiarImagen (capa,nombreImagen,objetoImagen) 
	{
	    if (document.layers && capa!=null)
		{
			eval('document.' + capa + '.document.images["' + nombreImagen + '"].src = ' + objetoImagen + '.src');
			eval('document.' + capa + '.document.images["' + nombreImagen + '"].useMap = ' + objetoImagen + '.useMap');
		}
		else
		{
			document.images[nombreImagen].src = eval(objetoImagen + ".src");
			document.images[nombreImagen].useMap = eval(objetoImagen + ".useMap");
		}	
	}
	
	
	function CambiarReproductor(nombre,altura,ancho)
	{
		document.getElementById(nombre).style.height=altura;
		document.getElementById(nombre).style.width=ancho;
	}
	
	function CambiarPosicion(nombre,arriba,izquierda)
	{
		if(navigator.appName=="Microsoft Internet Explorer")
		{
			document.getElementById(nombre).style.top=arriba;
			document.getElementById(nombre).style.left=izquierda;
		}	
		else
		{
			if(nombre=="reproductor")
			{
				var a=arriba-7;
				var i=izquierda-2;
				document.getElementById(nombre).style.top=a+"px";
				document.getElementById(nombre).style.left=i+"px";
			}	
			else
			{	
				document.getElementById(nombre).style.top=arriba+"px";
				document.getElementById(nombre).style.left=izquierda+"px";
			}	
		}
		
	}
	
	function mostrar(capa)
	{
		document.getElementById(capa).style.visibility='visible';
	}	
	
	function ocultar(capa)
	{
		document.getElementById(capa).style.visibility='hidden';
	}	
	
	function añadir(Capa)
	{
		var x=eval('document.getElementById(Capa).lastChild.id');
		if(x==null)
		{
			x=0;
		}
		x++;
		var y=document.getElementById("exam").value;
		var medio=preguntar();
		co = prompt('Ponle un nombre al medio','Cancion o Video'); 
		if (co==null)
		{
			if (medio=="sonido.png")
				co="Cancion";
			else
				co="Video";	
		}
		document.getElementById(Capa).innerHTML+="<div id='"+x+"' class='trasp' style='width:95%; color:#FFFFFF;'><img src='"+medio+"' href='#' width='30' height='30'></img></div>";
		document.getElementById(x).innerHTML+="<div id='"+y+"' onClick='play('this.id')'> "+x+" . "+co+"</div>";
		play(y);
		document.getElementById("exam").value="";	
	}
	
	
	function tiempo()
	{
		var timer = window.setInterval("MyText.value = reprod.controls.currentPositionString",1000);
	}
	
	function fondo(col,i)
	{
		document.getElementById(i).style.backgroundColor=col;
	}
	
	function pantallacompleta()
	{
		document.getElementById("reprod").fullscreen=true;
	}
			
	function eliminar(ca)
	{
		var h=document.getElementById(ca).lastChild.id;
		for(var i=1;i<=h;i++)
		{
			if(document.getElementById(i)!=null)
			{
				if(document.getElementById(i).style.backgroundColor=='palevioletred')
				{
					var viejo=document.getElementById(i);
					document.getElementById(ca).removeChild(viejo);	
				}
			}	
		}
		var puntero=document.getElementById(ca);
		if(puntero.childNodes.length>2)
		{
			var n=1;
			while(document.getElementById(n)==null)
			{
				n++;
			}
			var l=document.getElementById(n).lastChild.id;
			play(l);
		}
		else
		{
			stop('reprod');
			document.getElementById('reprod').URL="";
		}	
	}	
	
	function cancionSig()
	{
		var l=document.getElementById('reprod').URL;
		if(document.getElementById(l)==null)
		{
			n=document.getElementById('listareprd').lastChild.id;
			while(document.getElementById(n)==null)
			{
				n--;
			}	
			l=document.getElementById(n).lastChild.id;
           	play(l);
		}
		else
		{
			var n=document.getElementById(l).parentNode.id;
			var h=document.getElementById(n).parentNode.lastChild.id;
			if(n<h)
			{
				n++;
				while(document.getElementById(n)==null)
				{
					n++;
				}	
				l=document.getElementById(n).lastChild.id;
				play(l);
			}
			else
			{
				n=1;
				while(document.getElementById(n)==null)
				{
					n++;
				}	
				l=document.getElementById(n).lastChild.id;
				play(l);
			}		
		}
	}	
	
	
	function cancionAnt()
	{
		var	l=document.getElementById('reprod').URL;
		if(document.getElementById(l)==null)
		{
			n=1;
			while(document.getElementById(n)==null)
			{
				n++;
			}	
			l=document.getElementById(n).lastChild.id;
           	play(l);
		}
		else
		{	
			var n=document.getElementById(l).parentNode.id;
			if(n>1)
			{
				n--;
				while(document.getElementById(n)==null)
				{
					n--;
				}	
				l=document.getElementById(n).lastChild.id;
				play(l);
			}
			else
			{
				n=document.getElementById(n).parentNode.lastChild.id;
				l=document.getElementById(n).lastChild.id;
				play(l);
			}
		}			
	}
	
	function preguntar()
	{
		confirmar=confirm("¿Es un archivo de audio?");
		if (confirmar)
		{
			var a="sonido.png";
		}
		else
		{
			var a="video.png";
		}
		return a;
	}
	
	</script>
  #2 (permalink)  
Antiguo 18/01/2008, 07:45
Avatar de Raulmmmm  
Fecha de Ingreso: marzo-2007
Ubicación: En otro lugar que tú
Mensajes: 1.549
Antigüedad: 17 años
Puntos: 36
Re: Problema Firefox

Si no nos dices qué error te da difícilmente te lo vamos a poder solucionar.
  #3 (permalink)  
Antiguo 18/01/2008, 11:18
 
Fecha de Ingreso: enero-2008
Mensajes: 2
Antigüedad: 16 años, 3 meses
Puntos: 0
Re: Problema Firefox

a ver, lo k implementa es un reproductor, pero con las skins hechas por mi con un mapa sensible. pues m funciona todo bien, pero lo unico k al cmbiar d skin el reproductor tiene k cmbiar d ancho, alto y d posicion, pues esto m lo hace bien en explorer y tmb en dos de las skins(en firefox), pero en una no cambia el ancho ni el alto(en firefox).... es raro xk en las demas si lo hace bien, y solo falla en esa.
aki pongo el html, para que entiendas mejor el funcionamiento. gracias ;)

Código:
<title>Reproductor</title>
</head>

<body onLoad="precargar('Mini','Mini.jpg','#skin3'),precargar('Cambio','Reproductor1 copia.jpg','#skin2'),precargar('Normal','reproductor copia.jpg','#skin'),precargar('Lista1','lista 1.jpg','#lista 1'),precargar('Lista2','lista 2.jpg','#lista 2'),precargar('ListaMini','lista mini.jpg','#lista mini'),setOpacity('exam',0),comprobarcss();">
	
    <div id="reproductor" style="position:absolute;	left:72px; top:112px;">
	 	 	<object classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" style="height:140px; width:228px;" id="reprod">
	    	<param name="autostart" value="false">
			<param name="uiMode" value="none">
			</object>
	</div>
	
	<div id="caratula" style="position:absolute;">
	
	<img src="reproductor copia.jpg"  name="mascara" border="0" usemap="#skin">
	<map name="skin">
		  <area shape="circle" coords="46,266,19" href="#" onClick="rew('reprod')">
          <area shape="circle" coords="87,279,20" href="#" onClick="cancionAnt()">
          <area shape="circle" coords="264,277,20" href="#" onClick="cancionSig()">
	      <area shape="circle" coords="131,285,18" href="#" onClick="stop('reprod')">
		  <area shape="circle" coords="219,287,17" href="#" onClick="pause('reprod')">
     	  <area shape="circle" coords="308,268,17" href="#" onClick="pos('reprod')">
		  <area shape="circle" coords="35,82,11" href="#" onClick="mute('reprod')">
          <area shape="circle" coords="299,53,9" href="#" onClick="window.close()">
	      <area shape="rect" coords="263,45,280,53" href="#" onClick="CambiarImagen('caratula','mascara','Mini') ,CambiarReproductor('reprod',110,145),CambiarPosicion('reproductor',36,25),CambiarImagen('lista','listado','ListaMini'),CambiarPosicion('lista',13,300),CambiarPosicion('listareprd',48,5),CambiarPosicion('exam',-34,-10),CambiarPosicion('MyText',129,57)">
          <area shape="circle" coords="58,58,8" href="#" onClick="bajVol('reprod')">
		  <area shape="circle" coords="102,58,10" href="#" onClick="subVol('reprod')">
		  <area shape="circle" coords="156,261,10" href="#" onClick="rep('reprod')">
	      <area shape="rect" coords="180,253,198,272" href="#" onClick="CambiarImagen('caratula','mascara','Cambio'),CambiarReproductor('reprod',116,130),CambiarPosicion('reproductor',81,169),CambiarImagen('lista','listado','Lista2'),CambiarPosicion('lista',52,450),CambiarPosicion('listareprd',42,40),CambiarPosicion('exam',-32,-32),CambiarPosicion('MyText',40,205)">
          <area shape="circle" coords="173,296,21" href="#" onClick="play()">
   	      <area shape="rect" coords="205,57,225,69" href="#" onClick="balRight('reprod')">
          <area shape="rect" coords="164,56,195,70" href="#" onClick="balCenter('reprod')">
          <area shape="rect" coords="136,57,154,69" href="#" onClick="balLeft('reprod')">
          <area shape="rect" coords="322,133,332,223" href="#" onClick="mostrar('lista')">
    	  <area shape="rect" coords="307,73,328,92" href="#" onClick="pantallacompleta()">
    </map>
	
    <map name="skin2">
		<area shape="rect" coords="337,84,358,104" href="#" onClick="CambiarImagen('caratula','mascara','Normal'),CambiarReproductor('reprod',140,228),CambiarImagen('lista','listado','Lista1'),CambiarPosicion('lista',50,352),CambiarPosicion('listareprd',42,60),CambiarPosicion('reproductor',112,72),CambiarPosicion('exam',-33,-52),CambiarPosicion('MyText',70,167)">
 		<area shape="rect" coords="143,267,192,291" href="#" onClick="rew('reprod')">
    	<area shape="rect" coords="258,266,308,291" href="#" onClick="pos('reprod')">
        <area shape="rect" coords="295,219,321,244" href="#" onClick="pause('reprod')">
        <area shape="rect" coords="350,204,397,225" href="#" onClick="cancionSig()">
        <area shape="rect" coords="128,216,157,245" href="#" onClick="stop('reprod')">
        <area shape="rect" coords="54,201,106,224" href="#" onClick="cancionAnt()">
        <area shape="rect" coords="313,162,337,176" href="#" onClick="balLeft('reprod')">
        <area shape="rect" coords="344,161,379,176" href="#"  onClick="balCenter('reprod')">
        <area shape="rect" coords="387,162,413,175" href="#" onClick="balRight('reprod')">
        <area shape="rect" coords="362,101,378,120" href="#" onClick="window.close()">
        <area shape="circle" coords="224,208,21" href="#" onClick="play()">
		<area shape="circle" coords="223,283,9" href="#" onClick="rep('reprod')">
		<area shape="circle" coords="44,162,8" href="#" onClick="bajVol('reprod')">
        <area shape="circle" coords="87,162,9" href="#" onClick="subVol('reprod')">
		<area shape="rect" coords="124,153,142,175" href="#" onClick="mute('reprod')">
    	<area shape="poly" coords="82,125,128,91,114,75,71,112" href="#" onClick="mostrar('lista'),CambiarPosicion('lista',52,450),CambiarPosicion('listareprd',42,40),CambiarPosicion('exam',-32,-32),CambiarPosicion('MyText',40,205)">
    </map>
	
    <map name="skin3">		
		<area shape="rect" coords="200,45,220,63" href="#" onClick="stop('reprod')">
   	  	<area shape="circle" coords="210,76,8" href="#" onClick="play()">
	  	<area shape="rect" coords="200,90,216,105" href="#" onClick="pause('reprod')">
   	  	<area shape="rect" coords="173,70,196,80" href="#" onClick="cancionAnt()">
      	<area shape="rect" coords="223,71,245,81" href="#" onClick="cancionSig()">
        <area shape="rect" coords="207,9,223,24" href="#" onClick="CambiarImagen('caratula','mascara','Normal'),CambiarImagen('lista','listado','Lista1'),CambiarReproductor('reprod',140,228),CambiarPosicion('lista','50','352'),CambiarPosicion('listareprd','42','60'),CambiarPosicion('reproductor','112','72'),CambiarPosicion('exam',-33,-52),CambiarPosicion('MyText',70,167)">
      	<area shape="rect" coords="227,7,241,26" href="#" onClick="window.close()">
		<area shape="circle" coords="181,124,8" href="#" onClick="bajVol('reprod')">
		<area shape="circle" coords="226,123,8" href="#" onClick="subVol('reprod')">
    	<area shape="rect" coords="48,0,128,22" href="#" onClick="mostrar('lista'),CambiarPosicion('lista',13,300),CambiarPosicion('listareprd',48,5),CambiarPosicion('exam',-34,-10),CambiarPosicion('MyText',129,57)">
	</map>
	</div>
	
    
<div id="lista" onMouseDown="dragStart(event,'lista')" style="position:absolute; top:50px; left:352px; visibility:hidden;" >
    
    	        	
		<img src="lista 1.jpg" usemap="#lista 1" border="-1" name="listado">
		<div style="position:absolute; left:60px; top:42px; width:275px;" id="listareprd">
        <input name="exam" id="exam" type="file" onChange="añadir('listareprd')"/>
        </div>
        
		<map name="lista 1">
   	    	<area shape="rect" coords="116,8,184,26" href="#" onClick="eliminar('listareprd')">
            <area shape="rect" coords="373,7,396,27" href="#" onClick="ocultar('lista')">
		</map>
		
		<map name="lista 2">
      		<area shape="rect" coords="128,12,199,27" href="#" onClick="eliminar('listareprd')">
            <area shape="rect" coords="325,7,341,28" href="#" onClick="ocultar('lista')">
		</map>
	
		<map name="lista mini">
	   		<area shape="rect" coords="111,11,187,29" href="#" onClick="eliminar('listareprd')">
            <area shape="rect" coords="244,4,265,30" href="#" onClick="ocultar('lista')">
        </map>
        
	</div>
	
  
	<div id="tiempo" style="position:absolute;">
		<input type="text" class="traspa" id="MyText" name="MyText">
	</div>
    
    </body>
</html>
  #4 (permalink)  
Antiguo 26/02/2008, 10:04
 
Fecha de Ingreso: agosto-2002
Mensajes: 5
Antigüedad: 21 años, 8 meses
Puntos: 0
Re: Problema Firefox

No tengo mucho tiempo ahora para responder, pero echándole un vistazo rápido al código js, veo que utilizas "this" en varias ocasiones.

Funciona a las mil maravillas en IE, pero no está implementado en Firefox que yo sepa.

Pégale un repaso a esas secciones.

Saludos.
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 10:40.