Results 1 to 8 of 8

Thread: Manual Scroller

  1. #1
    Join Date
    May 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Manual Scroller

    1) Script Title: Manual Scroller

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

    3) Describe problem: I need this script to jump back to the start at the end of the scroll, my javascript is very poor I am more of a PHP man, any help woul dbe much appreciated.

    Thxs
    IJS

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    More PHP for me too.

    However, a question of clarification--
    Should it loop or jump back? The difference is that looping would be smooth and jumping would be obvious to someone watching it. Depending on use, you might need one or the other.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. #3
    Join Date
    May 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    A loop would be great or a jump back to the top as in the top action in the script

  4. #4
    Join Date
    May 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I have tried a few things with this but , i still have not managed it, any help would be much appreciated

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

    Default

    I assume you mean move back up and scroll down again in a loop? If so, just replace the old function movedown() with the below instead:

    Code:
    function movedown(){
    if (window.moveupvar) clearTimeout(moveupvar)
    if (iens6){
    if (parseInt(crossobj.style.top)>=(contentheight*(-1)+100))
    crossobj.style.top=parseInt(crossobj.style.top)-speed+"px"
    else
    crossobj.style.top=0
    }
    else if (ns4&&crossobj.top>=(contentheight*(-1)+100))
    crossobj.top-=speed
    movedownvar=setTimeout("movedown()",20)
    }

  6. #6
    Join Date
    May 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Many Thanks!!

    The function works perfect, one last tweak would be great, could I set a delay before it jumps back to the top?

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

    Default

    To enable a pause before the content scrolls back up and downwards again, use the below movedown() function instead:

    Code:
    function movedown(){
    if (window.moveupvar) clearTimeout(moveupvar)
    if (iens6){
    if (parseInt(crossobj.style.top)>=(contentheight*(-1)+100)){
    crossobj.style.top=parseInt(crossobj.style.top)-speed+"px"
    movedownvar=setTimeout("movedown()",20)
    }
    else
    movedownvar=setTimeout("crossobj.style.top=0; movedown()", 1000)
    }
    }
    Here 1000 means wait for 1 second- you can change that to your own.

  8. #8
    Join Date
    May 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    You are a star, many many thanks!

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
  •