Comunidad de diseño web y desarrollo en internet online

Scroll Noticias Vertical - Fallo en IExplorer

Citar            
MensajeEscrito el 25 Mar 2012 12:04 pm
Estoy usando el código que pongo al final de la nota y tengo un problema de navegador. En Firefox/Chrome/etc funciona sin problemas. En IExplorer se sale del "recuadro" y el texto ocupa todo el alto de la página, sin limitarse al "#marqueecontainer". Alguna sugerencia/ayuda/tal vez solución?
Muchas gracias.

Posteo aquí el código.

Código :

#marqueecontainer{
position: relative;
width: 266px; /*marquee width */
height: 200px; /*marquee height */
background-color: white;
overflow: hidden;
padding: 2px;
padding-left: 4px;
}


Código Javascript :

/***********************************************
* Cross browser Marquee II- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/
 
var delayb4scroll=2000 //Specify initial delay before marquee starts to scroll on page (2000=2 seconds)
var marqueespeed=1.5 //Specify marquee scroll speed (larger is faster 1-10)
var pauseit=1 //Pause marquee onMousever (0=no. 1=yes)?
 
////NO NEED TO EDIT BELOW THIS LINE////////////
 
var copyspeed=marqueespeed
var pausespeed=(pauseit==0)? copyspeed: 0
var actualheight=''
 
function scrollmarquee(){
if (parseInt(cross_marquee.style.top)>(actualheight*(-1)+8))
cross_marquee.style.top=parseInt(cross_marquee.style.top)-copyspeed+"px"
else
cross_marquee.style.top=parseInt(marqueeheight)+8+"px"
}
 
function initializemarquee(){
cross_marquee=document.getElementById("vmarquee")
cross_marquee.style.top=0
marqueeheight=document.getElementById("marqueecontainer").offsetHeight
actualheight=cross_marquee.offsetHeight
if (window.opera || navigator.userAgent.indexOf("Netscape/7")!=-1){ //if Opera or Netscape 7x, add scrollbars to scroll and exit
cross_marquee.style.height=marqueeheight+"px"
cross_marquee.style.overflow="scroll"
return
}
setTimeout('lefttime=setInterval("scrollmarquee()",30)', delayb4scroll)
}
 
if (window.addEventListener)
window.addEventListener("load", initializemarquee, false)
else if (window.attachEvent)
window.attachEvent("onload", initializemarquee)
else if (document.getElementById)
window.onload=initializemarquee


Código HTML :

<div id="marqueecontainer" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">
<div id="vmarquee" style="position: absolute; width: 98%;">
 
<!--YOUR SCROLL CONTENT HERE-->
 
Aquí va todo el contenido que obvio para no sobrecargar innesariamente, ya que es todo texto.
 
<!--YOUR SCROLL CONTENT HERE-->
 
</div>
</div>




De nuevo, muchas gracias por adelantado.

Por Greca

1 de clabLevel



 

chrome
Citar            
MensajeEscrito el 25 Mar 2012 01:46 pm
En IE7 y anteriores hay un bug, cuando tienes posición relativa y overflow:hidden, el overflow deja de funcionar, tal vez ese es tu problema, la solución es ponerle otra posición relativa al div contenedor de #marqueecontainer.

saludos

Por HtrMancera

Claber

342 de clabLevel

1 tutorial

Genero:Masculino  

Front-end Developer

chrome
Citar            
MensajeEscrito el 25 Mar 2012 02:01 pm
Pruebo y te cuento.. Mil gracias HTrMancera

Por Greca

1 de clabLevel



 

chrome
Citar            
MensajeEscrito el 25 Mar 2012 10:31 pm
Gracias HtrMancera.

Funcionó perfectamente....

Por Greca

1 de clabLevel



 

chrome

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.