SitePoint Sponsor

User Tag List

Results 1 to 10 of 10

Thread: page scroll

  1. #1
    SitePoint Addict Garrett's Avatar
    Join Date
    Feb 2001
    Location
    England
    Posts
    352
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Angry page scroll

    hello

    i've been trying to get this script working forever now and it always fails to work fully. the rollover that triggers the scroll is in another frame so it passes the frame and frameset so that it can scroll the page down, it does scroll but never to the bottom and i've no idea why, ideas???

    a+
    gar


    function movedown(frame,frameset) {

    if (frameset == 'parent')
    {
    if (document.all && y < parent[frame].document.body.scrollHeight || document.height && y < parent[frame].document.height)
    {
    parent[frame].scroll(0,y);
    y = y + 4;
    when = setTimeout('movedown("' + frame + '","' + frameset + '")',1);
    }
    } else {
    if (document.all && y < self[frame].document.body.scrollHeight || document.height && y < self[frame].document.height)
    {
    self[frame].scroll(0,y);
    y = y + 4;
    when = setTimeout('movedown("' + frame + '","' + frameset + '")',1);
    }
    }


    }

  2. #2
    SitePoint Enthusiast
    Join Date
    Mar 2002
    Location
    Birmingham, UK
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try making the scroll advance by one instead of four

    y = y + 1;

  3. #3
    SitePoint Addict Garrett's Avatar
    Join Date
    Feb 2001
    Location
    England
    Posts
    352
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    nope that does'nt change anything! just makes it dead slow to scroll.

    any other ideas, or anyone got a frame scrolling script that works?

    a+
    gar

  4. #4
    Perl/Mason Guru Flawless_koder's Avatar
    Join Date
    Feb 2002
    Location
    Gatwick, UK
    Posts
    1,206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    yeah

    I did one ages ago... let me see if i can find it.

    *shuffles papers... realises that's got nothing to do with it... looks through files on passway.org [ Flawless development domain]*

    .oO( I seem to remember showing someone in WD:1 how to do it... )

    http://www.passway.org/RushTortoise.html

    As you can tell.. this was done for RushCode (quick).

    Hope you can gleam something from it

    Flawless
    ---=| If you're going to buy a pet - get a Shetland Giraffe |=---

  5. #5
    SitePoint Enthusiast
    Join Date
    Mar 2002
    Location
    Birmingham, UK
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    try this

    <script language="JavaScript1.2">
    var speed=4
    var currentpos=0,alt=1,curpos1=0,curpos2=-1
    function initialize(){
    startit()
    }
    function scrollwindow(){
    if (document.all)
    temp=document.body.scrollTop
    else
    temp=window.pageYOffset
    if (alt==0)
    alt=1
    else
    alt=0
    if (alt==0)
    curpos1=temp
    else
    curpos2=temp
    if (curpos1!=curpos2){
    if (document.all)
    currentpos=document.body.scrollTop+speed
    else
    currentpos=window.pageYOffset+speed
    window.scroll(0,currentpos)
    }
    else{
    currentpos=0
    window.scroll(0,currentpos)
    }
    }
    function startit(){
    setInterval("scrollwindow()",10)
    }
    window.onload=initialize
    </script>

  6. #6
    SitePoint Addict Garrett's Avatar
    Join Date
    Feb 2001
    Location
    England
    Posts
    352
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: yeah

    Originally posted by Flawless_koder
    I did one ages ago... let me see if i can find it.

    http://www.passway.org/RushTortoise.html

    As you can tell.. this was done for RushCode (quick).
    mmm thats a layer scroll, dont like those i am trying to do one with frames.

    >philmadden87

    tried yours, and not sure how it works but the scroll goes mad and just keeps scrolling up and down non-stop, help?

    i can see this is just a down scroll and it uses the frame its in but how come it seems to jump to the top of the page when it has scrolled to the bottom?

    a+
    gar

  7. #7
    Perl/Mason Guru Flawless_koder's Avatar
    Join Date
    Feb 2002
    Location
    Gatwick, UK
    Posts
    1,206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Blind my stupidity

    I'm obviously REALLY stupid.

    I'm sorry, you're RIGHT.. that ISN'T an iframe... and an iframe ISN'T a frame.

    newsFrame object DOESN'T exist in that page, and it's ACTUALLY a layer.... how STUPID of me.



    Mind you .. what would i know anyway

    Flawless
    ---=| If you're going to buy a pet - get a Shetland Giraffe |=---

  8. #8
    SitePoint Addict Garrett's Avatar
    Join Date
    Feb 2001
    Location
    England
    Posts
    352
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Blind my stupidity

    Originally posted by Flawless_koder
    I'm obviously REALLY stupid.

    I'm sorry, you're RIGHT.. that ISN'T an iframe... and an iframe ISN'T a frame.

    newsFrame object DOESN'T exist in that page, and it's ACTUALLY a layer.... how STUPID of me.



    Mind you .. what would i know anyway

    Flawless

    yeah yeah keep your knickers on i'm having a look, i only looked as far as <div id="id2" style="width: 267px"> the last time.

    a+
    gar

  9. #9
    Perl/Mason Guru Flawless_koder's Avatar
    Join Date
    Feb 2002
    Location
    Gatwick, UK
    Posts
    1,206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    apology

    Sorry, i'm a bit irratable right now and i HATE having my work quesitoned.

    If you think you got a snappy response you should see what i said to someone else:
    http://sitepointforums.com/showthrea...threadid=49695

    I appreciate you might have missed the iframe, easy mistake!



    Flawless
    ---=| If you're going to buy a pet - get a Shetland Giraffe |=---

  10. #10
    SitePoint Addict Garrett's Avatar
    Join Date
    Feb 2001
    Location
    England
    Posts
    352
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    >Flawless_koder

    ok finally had time to get into your code and see how to change it to my needs, first question is - why do it this way....

    function sH(){
    nF = parent.document.frames("newsFrame");
    nF.document.body.appendChild(nF.document.createElement('<DIV id=iend>'));
    H=nF.iend.offsetTop-nF.document.body.offsetHeight;
    }


    when simply this works?


    function sH(){
    nF = parent.document.frames("newsFrame");
    H = parent.document.frames("newsFrame").body.scrollHeight;
    }

    i'm not being annoying its just maybe there is an advantage your way and thats why you choose to code it that way?

    anyway also noticed that you don't code for ns unfortunitly i do so any ideas on what ns is triping up on in your code?

    a+
    gar


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
  •