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.
This part of the code goes in the page where the scrolling is to be displayed.Code://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>
Code:<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>



Reply With Quote


Bookmarks