JavaScript - Necesito ayuda con este scroll

 
Vista:

Necesito ayuda con este scroll

Publicado por gustavo (1 intervención) el 28/09/2006 23:02:22
Hola, antes que nada queria que sepan que son novato en este tema, necesito que alguien me diga como puedo modificar la posicion de este scroll que voy a poner a continuacion, cuales son las variables que debo modificar, ya que me aparece siempre en el mismo lugar. no donde yo quiero. Desde Ya muchas gracias
Este es el Script:
<!-- Mas trucos y scripts en http://www.javascript.com.mx -->
<SCRIPT>
var textbgcolor="#dddddd"
var textwidth=200
var textheight=200
var textborder=4
var textbordercolor="#00ffff"
var i_text=0
var textcontent=""
var thisspan=""
var content=""
var contentbg=""
var toggle=1
var timer
var scrollready=true
var tablewidth
var tableheight
var step=1
var content
var padding=3
var textcontentheight
var ie=document.all?1:0
var ns6=document.getElementById&&!document.all?1:0
var ns4=document.layers?1:0

if (ie || ns6) {
document.write('<table cellpadding=0 cellspacing=0 border=0 height='+textheight+' width='+textwidth+'><tr><td>');
document.write('<div id="marker" style="position:relative; width:'+textwidth+'; height:'+textheight+'"></div>');
document.write('</td></tr></table>')
if (ns6) {
var tablewidth=textwidth-2*textborder
var tableheight=textheight-2*textborder
}
else {
var tablewidth=textwidth
var tableheight=textheight
}
document.write('<div ID="roof" style="position:absolute;width:'+tablewidth+'px;height:'+tableheight+'px;border-style:solid;border-width:'+textborder+'px;border-color:'+textbordercolor+';background-color:'+textbgcolor+';overflow:hidden;visibility:hidden" onMouseOver="setscrollready(0)" onMouseOut="setscrollready(1)">')
document.write('<span ID="ticker" style="position:absolute;top:0px;left:0px;visibility:hidden">')
}

if (ns4) {
document.write('<table cellpadding=0 cellspacing=0 border=0 height='+textheight+' width='+textwidth+'><tr><td>');
var widthMinusTwoBorder=textwidth-2*textborder
var heightMinusTwoBorder=textheight-2*textborder
var widthMinusFourBorder=textwidth-4*textborder
var heightMinusFourBorder=textheight-4*textborder

}

</script>
<ilayer name="marker" bgcolor=&{textbordercolor}; width=&{textwidth}; height=&{textheight};></ilayer>
<layer name="tickerbg" left=&{textborder}; top=&{textborder}; width=&{widthMinusTwoBorder}; height=&{heightMinusTwoBorder}; bgcolor=&{textbgcolor}; visibility=hide> </layer>
<layer name="roof" width=&{widthMinusTwoBorder}; height=&{heightMinusFourBorder};>
<layer name="ticker" visibility=hide width=&{widthMinusTwoBorder}; left=&{textborder}; top=&{textborder}; onMouseOver="setscrollready(0)" onMouseOut="setscrollready(1)">

<table cellpadding=3><tr><td><font face="Verdana" color="#99FFFF" size=2><font face="Comic Sans MS" color="#FFFFFF" size=3><strong>Scroller totalmente gratuito</strong></font><br>Si te gusta copia y pega el codigo en tu web.<img src="closeb.gif" align=right><br>Acepta codigos html <a href="../default.htm" target="_blank"> links</a> y todo lo que quieras poner. <strong>Imágenes</strong> colores etc<br><hr><font face="Comic Sans MS" color="#FF0000" size=3><strong>Ah ! y no te olvides</strong></font><br>de poner esta web en tus favoritos.<br><hr><font face="Comic Sans MS" color="#FF0000" size=3><strong>Siempre te puede resultar util.</strong></font><br>Saludos y hasta pronto amigo.</font><br><hr></td></tr></table>
</layer></layer>
<script>
if (ns4) {
document.write('</td></tr></table>')
}
if (ie || ns6) {
document.write('</span></div>')
}
function doscroll(){
if (scrollready) {
if(ns4){
document.roof.document.ticker.top+=-step;
if(document.roof.document.ticker.top<-textcontentheight) {
document.roof.document.ticker.top=textheight;
}
}
if (ie) {
document.all.ticker.style.posTop+=-step
if (document.all.ticker.style.posTop<-textcontentheight) {
document.all.ticker.style.posTop=textheight
}
}
if (ns6) {
document.getElementById('ticker').style.top=parseInt(document.getElementById('ticker').style.top)-step
if (parseInt(document.getElementById('ticker').style.top)<-textcontentheight) {
document.getElementById('ticker').style.top=textheight
}
}
timer=setTimeout("doscroll()",50)
}
else {
clearTimeout(timer)
}
}

function DL_GetElementLeft(eElement) {
var nLeftPos = eElement.offsetLeft;
var eParElement = eElement.offsetParent;
while (eParElement != null) {
nLeftPos += eParElement.offsetLeft;
eParElement = eParElement.offsetParent;
}
return nLeftPos;
}

function DL_GetElementTop(eElement) {
var nTopPos = eElement.offsetTop;
var eParElement = eElement.offsetParent;
while (eParElement != null) {
nTopPos += eParElement.offsetTop;
eParElement = eParElement.offsetParent;
}
return nTopPos;
}

function initscroller(){
if (ns4) {
var thisspan=eval("document.roof.document.ticker")
textcontentheight=thisspan.clip.bottom-thisspan.clip.top;
document.roof.left=document.marker.pageX
document.roof.top=document.marker.pageY+1*textborder
document.tickerbg.left=document.marker.pageX+1*textborder
document.tickerbg.top=document.marker.pageY+1*textborder
document.roof.clip.width=textwidth;
document.roof.clip.height=textheight-2*textborder;
thisspan.top=textheight;
thisspan.clip.width=textwidth;
thisspan.clip.height=textcontentheight;
document.roof.visibility="show";
document.tickerbg.visibility="show";
thisspan.visibility="show";
}
if (ie) {
textcontentheight=document.all.ticker.clientHeight
document.all.roof.style.posLeft=DL_GetElementLeft(document.all.marker);
document.all.roof.style.posTop=DL_GetElementTop(document.all.marker);
document.all.ticker.style.posTop=textheight
document.all.ticker.style.clip='rect(0px, '+(textwidth-4)+'px, '+(textcontentheight)+'px, 0px)';
document.all.roof.style.visibility="visible";
document.all.ticker.style.visibility="visible";
}
if (ns6) {
textcontentheight=document.getElementById('ticker').offsetHeight
document.getElementById('roof').style.left=DL_GetElementLeft(document.getElementById('marker'));
document.getElementById('roof').style.top=DL_GetElementTop(document.getElementById('marker'));
document.getElementById('ticker').style.top=-textcontentheight
document.getElementById('ticker').clip='rect(0px, '+(textwidth-4)+'px, '+(textcontentheight)+'px, 0px)';
document.getElementById('roof').style.visibility="visible";
document.getElementById('ticker').style.visibility="visible";
}
doscroll()
}

function setscrollready(whatanswer) {
if (whatanswer==1) {
scrollready=true
checkscroll()
}
else {
scrollready=false
}
}

function checkscroll() {
clearTimeout(timer)
if (scrollready) {
doscroll()
}
}
function reopenpage() {
history.go(0)
}
window.onresize=reopenpage
window.onload=initscroller
</script>
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:Necesito ayuda con este scroll

Publicado por x (38 intervenciones) el 29/09/2006 14:25:00
no tengo ganas de adivinar... que se supone que hace? y que es lo que tu quieres hacer?
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar