Bienvenido(a), Visitante. Por favor, ingresa o regístrate.

Ingresar con nombre de usuario, contraseña y duración de la sesión

 
Búsqueda Avanzada

15.707 Mensajes en 3.130 Temas- por 371 Usuarios - Último usuario: lasfirrot
Mayo 22, 2012, 02:16:29
Foro de Hispabyte.netDiseño WebHosting y Desarrollo WebHTML / XML / Javascript (Moderador: D4MR0D)Tema: No funciona en Firefox!
Páginas: [1]   Ir Abajo
Imprimir
Autor Tema: No funciona en Firefox!  (Leído 673 veces)
0 Usuarios y 1 Visitante están viendo este tema.
k4tm41
Aprendiz
**
Mensajes: 53


Ver Perfil
« : Septiembre 26, 2005, 10:30:30 »


He bajado de internet una barra de scroll, pero resulta que parece ser que s?lo funciona para Internet Explorer. Parece ser que esto ocurre mucho, y me gustaria saber si puedo modificar el script para que sea compatible con Firefox.

muchas gracias
En línea
D4MR0D
Moderator
Miembro Imprescindible
*****
Mensajes: 1.069



Ver Perfil
« Respuesta #1 : Septiembre 27, 2005, 12:45:22 »

Si te refieres a la extensi?n CSS no estandar que cambia los colores de la/s barra/s de desplazamiento de la ventana del navegador, no, no puedes hacer que funcione en Firefox. Gecko no la implementa.

Que yo sepa funcionar? en Internet Explorer y en Konqueror. Quiz? en Safari tambi?n, si Apple ha portado esa parte de KHTML, aunque lo dudo, seguro que a ellos les gusta la interfaz de sus programas tal y como est? Sonrisa

Las versiones actuales de Opera no s? que har?n, pero antiguamente se pod?a activar el soporte desde los men?s de su interfaz. De todos modos, aun con el soporte activado, no funcionaba si se declaraba un doctype v?lido, pues el navegador entraba en modo de cumplimiento de estandares.
« Última modificación: Septiembre 27, 2005, 12:51:52 por D4MR0D » En línea
k4tm41
Aprendiz
**
Mensajes: 53


Ver Perfil
« Respuesta #2 : Septiembre 27, 2005, 01:41:07 »

Fallo m?o, sin poner el c?digo es dif?cil que pod?is entenderme. La barra de scroll no es la barra lateral, sino una barra de noticias en javascript, que va haciendo aparecer noticias de la web, sacadas de la BBDD.

Aqu? esta el c?digo de mi index.php
Código:
<script language=Javascript1.2>
// Utype
//  0 -> vertical scrolling
//  1 -> horizontal scrolling from left
// 2 -> horizontal scrolling from right
//  3 -> with cursor
var Utype=3;
// cursor for Utype 3, for example: "|" or "_"
var Ucursor="<SPAN class=blue> | </SPAN>";
// Box dimensions
var Uwidth=349;
var Uheight=16;
// Background color
var Ubgcolor="#000000";
// Background Image, if no, put ''
var Ubackground='';
// Speed
var Uspeed=30;
// stopping time (News), put 0 else
var Udelay=2000;
// first index of array to start
var Ufirst=0;

<?php
echo "var Umsgs=new Array();\n";
for ($i=0;$i<10;$i++)
{
echo "Umsgs[".$i."]='".$tabla[$i+1]."'\n";
}
Ultimate(Utype,Umsgs,Ucursor,Uwidth,Uheight,Ubgcolor,Ubackground,Uspeed,Udelay,Ufirst);
</SCRIPT>

Y aqu? la funci?n ultimate ubicada en ultimate.js
Código:
function Ultimate(Utype,Umsgs,Ucursor,Uwidth,Uheight,Ubgcolor,Ubackground,Uspeed,Udelay,Ufirst) {
  
document.writeln('<span id="Ubox" style="position:relative;width:'+Uwidth+';height:'+Uheight+';overflow:hiden;background-color:'+Ubgcolor+';background-image:url('+Ubackground+')">')
document.writeln('<div style="position:absolute;width:'+Uwidth+';height:'+Uheight+';clip:rect(0 '+Uwidth+' '+Uheight+' 0);left:0;top:0">')

if (Utype==0) {
  document.writeln('<div id="Utxt" style="position:absolute;width:'+Uwidth+';left:0;top:'+Uheight+';">')
  document.write(Umsgs[Ufirst]);
  Uscroll(Utxt,Umsgs,Uheight,Uspeed,Udelay,Ufirst);
}
if (Utype==1) {
  document.writeln('<div id="Utxt"  style="position:absolute;width:'+Uwidth+';left:'+Uwidth+';top:0;">')
  document.write(Umsgs[Ufirst]);
  Uside(Utxt,Umsgs,Uwidth,Uspeed,Udelay,Ufirst);
}
if (Utype==2) {
  document.writeln('<div id="Utxt"  style="position:absolute;width:'+Uwidth+';left:'+(Uwidth*-1)+';top:0;">')
  document.write(Umsgs[Ufirst]);
  Ureverseside(Utxt,Umsgs,Uwidth,Uspeed,Udelay,Ufirst,false);
}
if (Utype==3) {
  document.writeln('<div id="Utxt"  style="position:absolute;width:'+Uwidth+';left:0;top:0;overflow:hiden;background-color:'+Ubgcolor+';">')
  document.write(Umsgs[Ufirst]);
  document.writeln('</div>')
  document.writeln('<div id="Umask"  style="position:absolute;width:'+Uwidth+';left:0;top:0;overflow:hiden;background-color:'+Ubgcolor+';">')
  document.write(Ucursor);
  Utouch(Utxt,Umask,Umsgs,Ucursor,Uwidth,Uspeed,Udelay,Ufirst,1,false);
}
document.writeln('</div>')
document.writeln('</div>')
document.writeln('</span>')
}

// Moves
function Uscroll(IDdiv,Umsgs,Uheight,Uspeed,Udelay,Ufirst){
ttxt=eval(IDdiv);
Ustep=eval(Ufirst);
if (ttxt.style.pixelTop>0&&ttxt.style.pixelTop<=5){
ttxt.style.pixelTop=0;
setTimeout("Uscroll(ttxt,Umsgs,Uheight,Uspeed,Udelay,Ustep)",Udelay);
return
}
else {
  if (ttxt.style.pixelTop>=ttxt.offsetHeight*-1){
  ttxt.style.pixelTop-=5
  setTimeout("Uscroll(ttxt,Umsgs,Uheight,Uspeed,Udelay,Ustep)",Uspeed);
  return
  }
  else {
  ttxt.style.pixelTop=Uheight;
  if (Ustep>=Umsgs.length-1)
   Ustep=0
   else  
   Ustep++;
  ttxt.innerHTML=Umsgs[Ustep];
  Uscroll(ttxt,Umsgs,Uheight,Uspeed,Udelay,Ustep);
  }
}
}

function Uside(IDdiv,Umsgs,Uwidth,Uspeed,Udelay,Ufirst){
ttxt=eval(IDdiv);
Ustep=eval(Ufirst);
if (ttxt.style.pixelLeft>0&&ttxt.style.pixelLeft<=5){
ttxt.style.pixelLeft=0;
setTimeout("Uside(ttxt,Umsgs,Uwidth,Uspeed,Udelay,Ustep)",Udelay);
return
}
else {
  if (ttxt.style.pixelLeft>=ttxt.offsetWidth*-1){
  ttxt.style.pixelLeft-=5
  setTimeout("Uside(ttxt,Umsgs,Uwidth,Uspeed,Udelay,Ustep)",Uspeed);
  return
  }
  else {
  ttxt.style.pixelLeft=Uwidth;
  if (Ustep>=Umsgs.length-1)
   Ustep=0
   else  
   Ustep++;
  ttxt.innerHTML=Umsgs[Ustep];
  Uside(ttxt,Umsgs,Uwidth,Uspeed,Udelay,Ustep);
  }
}
}

function Ureverseside(IDdiv,Umsgs,Uwidth,Uspeed,Udelay,Ufirst,stop){
ttxt=eval(IDdiv);
Ustep=eval(Ufirst);
if (ttxt.style.pixelLeft>0&&ttxt.style.pixelLeft<=5&&(!stop)) {
setTimeout("Ureverseside(ttxt,Umsgs,Uwidth,Uspeed,Udelay,Ustep,true)",Udelay);
return
}
else {
  if (ttxt.style.pixelLeft<ttxt.offsetWidth){
  ttxt.style.pixelLeft+=5;
  setTimeout("Ureverseside(ttxt,Umsgs,Uwidth,Uspeed,Udelay,Ustep)",Uspeed);
  return
  }
  else {
  ttxt.style.pixelLeft=Uwidth*-1;
  if (Ustep>=Umsgs.length-1)
   Ustep=0
   else  
   Ustep++;
  ttxt.innerHTML=Umsgs[Ustep];
  Ureverseside(ttxt,Umsgs,Uwidth,Uspeed,Udelay,Ustep);
  }
}
}

function Utouch(IDdiv,IDmask,Umsgs,Ucursor,Uwidth,Uspeed,Udelay,Ufirst,Ufirstsens,stop){
ttxt=eval(IDdiv);
tmask=eval(IDmask);
Ustep=eval(Ufirst);
Usens=eval(Ufirstsens);
if (tmask.style.pixelLeft>Uwidth){
tmask.style.pixelLeft=Uwidth;
setTimeout("Utouch(ttxt,tmask,Umsgs,Ucursor,Uwidth,Uspeed,Udelay,Ustep,-1)",Udelay);
return
}
else if (tmask.style.pixelLeft>=-5&&tmask.style.pixelLeft<0&&(!stop)){
tmask.style.pixelLeft=-5;
if (Ustep>=Umsgs.length-1)
   Ustep=0
   else  
   Ustep++;
ttxt.innerHTML=Umsgs[Ustep];
setTimeout("Utouch(ttxt,tmask,Umsgs,Ucursor,Uwidth,Uspeed,Udelay,Ustep,1,true)",Udelay);
return
}
else {
  tmask.style.pixelLeft+=(5*Usens);
  setTimeout("Utouch(ttxt,tmask,Umsgs,Ucursor,Uwidth,Uspeed,Udelay,Ustep,Usens)",Uspeed);
  return
}
}

En internet explorer, como digo, me funciona a la perfecci?n, pero en Firefox no hay manera.

gracias por molestaros en leer todo el tocho
En línea
D4MR0D
Moderator
Miembro Imprescindible
*****
Mensajes: 1.069



Ver Perfil
« Respuesta #3 : Septiembre 27, 2005, 03:11:28 »

Claro que en Internet Explorer funciona a la perfecci?n, como que ese script est? escrito s?lo para ?l.

Habr?a que reescribir completamente el archivo ultimate.js. Varios errores:

En el CSS, hay varios overflow:hiden, cuando deber?an ser overflow:hidden

Las variables Utxt y Umask se usan globalmente sin declarar, deber?a usarse document.getElementById(Id) para darles valor.

Uso de PixelTop, PixelLeft, offsetWidth y dem?s que s?lo funcionan en IE.

En fin, no te extra?es que no funcione en Firefox (ni en nada que no sea Internet Explorer).
En línea
k4tm41
Aprendiz
**
Mensajes: 53


Ver Perfil
« Respuesta #4 : Septiembre 27, 2005, 10:17:28 »

Lo primero gracias por haberte le?do el c?digo y haber contestado, y lo segundo, presuponer entonces que cambiando simplemente eso q me has dicho, no funcionar?a para Firefox. Me temo que voy a tener que ir buscando otra barra....
En línea
Páginas: [1]   Ir Arriba
Imprimir
Foro de Hispabyte.netDiseño WebHosting y Desarrollo WebHTML / XML / Javascript (Moderador: D4MR0D)Tema: No funciona en Firefox!
Ir a:  


Tema diseñado por RJ-45 para Hispabyte.net basado en el
theme famouspadexx v.09 designed by Formado Comprido
Downloable here. My present to padexx.de