Results 1 to 3 of 3

Thread: Need To Modify

  1. #1
    Join Date
    Nov 2004
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Lightbulb Need To Modify

    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.

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

    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>

  2. #2
    Join Date
    Aug 2004
    Posts
    10,140
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Warning: Please include a link to the DD script in question in your post. See this thread for the proper posting format for asking a question.

    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.

  3. #3
    Join Date
    Aug 2005
    Posts
    54
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Default

    IMO, this is a needed upgrade. The scrolling methodology is not fluid.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •