Results 1 to 5 of 5

Thread: IFRAME Scroller Help

  1. #1
    Join Date
    Jan 2009
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Question IFRAME Scroller Help

    1) Script Title: IFRAME SCROLLER

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...e-scroller.htm

    3) Describe problem: Hi, I have managed to get the IFRAME Scroller onto a web page I am designing with no problems and it is great!

    One question though, when the scroller starts again from the beginning could you tell me how I could get it to delay scrolling once again? As it is at the moment the delay only happens when the page is first loaded.

    I hope you can help me!

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Change this:

    Code:
    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)
    }
    to:

    Code:
    function scrollDiv(){
     dataobj.style.top = parseInt(dataobj.style.top) - scrollspeed + "px";
     if (parseInt(dataobj.style.top) < thelength * (-1)) {
      dataobj.style.top = "5px";
      setTimeout(scrollDiv, initialdelay);
     } else
      setTimeout(scrollDiv, 40);
    };
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. The Following User Says Thank You to jscheuer1 For This Useful Post:

    jamespowell1989 (01-23-2009)

  4. #3
    Join Date
    Jan 2009
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Thanks a lot for your help! That's great! Working perfectly!

    Thanks again!

  5. #4
    Join Date
    Jan 2009
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Please could you help me change the code so that the ticker scrolls up from the bottom instead of just appearing!?

    Thanks for your help guys!

  6. #5
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    There are at least two approaches. Have it start out visible, but then when it repeats, have it come in from the bottom. For that use this function in place of the one we already replaced:

    Code:
    function scrollDiv(){
     dataobj.style.top = parseInt(dataobj.style.top) - scrollspeed + "px";
     if (parseInt(dataobj.style.top) < thelength * (-1))
      dataobj.style.top = (window.innerHeight? innerHeight : Math.max(document.documentElement.clientHeight, document.body.clientHeight)) + 5 + "px";
      setTimeout(scrollDiv, 40);
    };
    The other approach would be to have it always start from the bottom, even at the beginning. For that use the scrollDiv() function above, and also change this line:

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

    Code:
    function initializeScroller(){
    dataobj=document.all? document.all.datacontainer : document.getElementById("datacontainer")
    dataobj.style.top = (window.innerHeight? innerHeight : Math.max(document.documentElement.clientHeight, document.body.clientHeight)) + 5 + "px";
    setTimeout("getdataheight()", initialdelay)
    }
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

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
  •