Foros del Web » Programando para Internet » Javascript »

Scroll noticias vertical II

Estas en el tema de Scroll noticias vertical II en el foro de Javascript en Foros del Web. Estoy usando el código que [URL="http://www.forosdelweb.com/miembros/yanix/"]Yanix[/URL]recomendaba en [URL="http://www.forosdelweb.com/f13/scroll-noticias-vertical-117390/"]Scroll noticias vertical[/URL] y tengo un problema. En Firefox/Chrome/etc funciona sin problemas. En IExplorer se sale del "recuadro" ...
  #1 (permalink)  
Antiguo 24/03/2012, 18:39
 
Fecha de Ingreso: mayo-2010
Ubicación: Madrid
Mensajes: 19
Antigüedad: 14 años
Puntos: 0
Scroll noticias vertical II

Estoy usando el código que [URL="http://www.forosdelweb.com/miembros/yanix/"]Yanix[/URL]recomendaba en [URL="http://www.forosdelweb.com/f13/scroll-noticias-vertical-117390/"]Scroll noticias vertical[/URL] y tengo un problema. 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?

No obstante y para facilitar el trabajo, posteo de nuevo aquí el código.


Código CSS:
Ver original
  1. #marqueecontainer{
  2. position: relative;
  3. width: 266px; /*marquee width */
  4. height: 200px; /*marquee height */
  5. background-color: white;
  6. overflow: hidden;
  7. padding: 2px;
  8. padding-left: 4px;
  9. }

Código Javascript:
Ver original
  1. /***********************************************
  2. * Cross browser Marquee II- © Dynamic Drive (www.dynamicdrive.com)
  3. * This notice MUST stay intact for legal use
  4. * Visit http://www.dynamicdrive.com/ for this script and 100s more.
  5. ***********************************************/
  6.  
  7. var delayb4scroll=2000 //Specify initial delay before marquee starts to scroll on page (2000=2 seconds)
  8. var marqueespeed=1.5 //Specify marquee scroll speed (larger is faster 1-10)
  9. var pauseit=1 //Pause marquee onMousever (0=no. 1=yes)?
  10.  
  11. ////NO NEED TO EDIT BELOW THIS LINE////////////
  12.  
  13. var copyspeed=marqueespeed
  14. var pausespeed=(pauseit==0)? copyspeed: 0
  15. var actualheight=''
  16.  
  17. function scrollmarquee(){
  18. if (parseInt(cross_marquee.style.top)>(actualheight*(-1)+8))
  19. cross_marquee.style.top=parseInt(cross_marquee.style.top)-copyspeed+"px"
  20. else
  21. cross_marquee.style.top=parseInt(marqueeheight)+8+"px"
  22. }
  23.  
  24. function initializemarquee(){
  25. cross_marquee=document.getElementById("vmarquee")
  26. cross_marquee.style.top=0
  27. marqueeheight=document.getElementById("marqueecontainer").offsetHeight
  28. actualheight=cross_marquee.offsetHeight
  29. if (window.opera || navigator.userAgent.indexOf("Netscape/7")!=-1){ //if Opera or Netscape 7x, add scrollbars to scroll and exit
  30. cross_marquee.style.height=marqueeheight+"px"
  31. cross_marquee.style.overflow="scroll"
  32. return
  33. }
  34. setTimeout('lefttime=setInterval("scrollmarquee()",30)', delayb4scroll)
  35. }
  36.  
  37. if (window.addEventListener)
  38. window.addEventListener("load", initializemarquee, false)
  39. else if (window.attachEvent)
  40. window.attachEvent("onload", initializemarquee)
  41. else if (document.getElementById)
  42. window.onload=initializemarquee

Código HTML:
Ver original
  1. <div id="marqueecontainer" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">
  2. <div id="vmarquee" style="position: absolute; width: 98%;">
  3.  
  4. <!--YOUR SCROLL CONTENT HERE-->
  5.  
  6. Aquí va todo el contenido que obvio para no sobrecargar innesariamente, ya que es todo texto.
  7.  
  8. <!--YOUR SCROLL CONTENT HERE-->
  9.  
  10. </div>
  11. </div>

Muchas gracias por adelantado.

Etiquetas: funcion, scroll, vertical
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 00:30.