PDA

View Full Version : Need To Modify



arimakidd
11-12-2004, 05:40 PM
Here is an iframe script that does a vertical scroll of another html page. Cool, one problem, there is a delay before it starts over again. There is a value to reduce the time of the delay, but that doesn't help. What happens is that nearing the end of the script there is a gap between the end and when it starts over so the iframe screen just displays color background before the loop starts over. I don't want this, I want to see "Continous" text. No gaps in the scrolling. Can this script be modified or do I have to get another one? Here's the code that goes on the html page to be scrolled.



//The name of this page is scrolling_table.html
<script type="text/javascript">
//Specify speed of scroll. Larger=faster (ie: 5)
var scrollspeed=cache=7

//Specify intial delay before scroller starts scrolling (in miliseconds):
var initialdelay=1

function initializeScroller(){
dataobj=document.all? document.all.datacontainer : document.getElementById("datacontainer")
dataobj.style.top="5px"
setTimeout("getdataheight()", initialdelay)
}

function getdataheight(){
thelength=dataobj.offsetHeight
if (thelength==0)
setTimeout("getdataheight()",10)
else
scrollDiv()
}

function scrollDiv(){
dataobj.style.top=parseInt(dataobj.style.top)-scrollspeed+"px"
if (parseInt(dataobj.style.top)<thelength*(-1))
dataobj.style.top="5px"
setTimeout("scrollDiv()",40)
}

if (window.addEventListener)
window.addEventListener("load", initializeScroller, false)
else if (window.attachEvent)
window.attachEvent("onload", initializeScroller)
else
window.onload=initializeScroller


</script>


This part of the code goes in the page where the scrolling is to be displayed.



<script type="text/javascript">
//specify path to your external page:
var iframesrc="scrolling_table.html"

//You may change most attributes of iframe tag below, such as width and height:
document.write('<iframe id="datamain" src="'+iframesrc+'" width="172px" height="370px" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no"></iframe>')

</script>

ddadmin
11-16-2004, 04:56 AM
.

This is unfortunately a normal behavior with most of the iframe scrollers currently on DD. It's possible to remove the gap, though it would require rewriting most portions of the script. I can't say for sure if this will happen, though I'll consider it when updating our scripts moving forward.

AshleyQuick
08-19-2005, 04:42 PM
IMO, this is a needed upgrade. The scrolling methodology is not fluid. :cool: