Functionality to scroll into view? (autoamtically scroll to contentsin the bottom right corner of a

Discussion in 'Javascript' started by crazychrisy54@hotmail.com, Dec 19, 2007.

  1. Guest

    Hi there

    I am quite new to web technologies and wondered if there is anything
    available so that when a large web page is opened (containing scroll
    bars) you are automatically scrolled down and right to the contents
    within the bottom right hand corner of the page.

    Any ideas if this is possible and if so how would be very much
    appreciated
     
    , Dec 19, 2007
    #1
    1. Advertising

  2. Guest

    Re: Functionality to scroll into view? (autoamtically scroll tocontents in the bottom right corner of a large web page)

    Update: I have seen java script which will scroll down the page
    gradually, but I just want to refresh the page and then automatically
    focus the user to the bottom right corner without them having to wait.

    Thanks for your help in advance!
     
    , Dec 19, 2007
    #2
    1. Advertising

  3. David Mark Guest

    Re: Functionality to scroll into view? (autoamtically scroll tocontents in the bottom right corner of a large web page)

    wrote:
    > Hi there
    >
    > I am quite new to web technologies and wondered if there is anything
    > available so that when a large web page is opened (containing scroll
    > bars) you are automatically scrolled down and right to the contents
    > within the bottom right hand corner of the page.
    >
    > Any ideas if this is possible and if so how would be very much
    > appreciated


    For browsers that support the window properties scrollMaxX and
    scrollMaxY, as well as the scrollTo method, this is a trivial
    proposition. However, IE doesn't qualify and depending on what
    versions, doctypes and styles you need to support, the universal
    solution can range from very simple to very complex. The scrollWidth
    and scrollHeight properties of either the body or documentElement hold
    the needed dimensions (presuming those elements are free of margins.)
    The trick is figuring out which one. If you only need to support
    IE6/7, it is simple enough to check document.compatMode (see the FAQ
    entry on measuring the size of the viewport.)

    Various implementations of this functionality will be future topics of
    the Code Worth Recommending project.
     
    David Mark, Dec 19, 2007
    #3
  4. Guest

    Re: Functionality to scroll into view? (autoamtically scroll tocontents in the bottom right corner of a large web page)

    On Dec 19, 3:48 pm, Randy Webb <> wrote:
    > said the following on 12/19/2007 9:41 AM:
    >
    > > Update: I have seen java script which will scroll down the page
    > > gradually, but I just want to refresh the page and then automatically
    > > focus the user to the bottom right corner without them having to wait.

    >
    > > Thanks for your help in advance!

    >
    > Put an anchor at the bottom of the page, set the hash property on the
    > location. Or, just link directly to the hash.
    >
    > --
    > Randy
    > Chance Favors The Prepared Mind
    > comp.lang.javascript FAQ -http://jibbering.com/faq/index.html
    > Javascript Best Practices -http://www.JavascriptToolbox.com/bestpractices/


    Cheers Randy, very clever!
     
    , Dec 19, 2007
    #4
  5. Guest

    Re: Functionality to scroll into view? (autoamtically scroll tocontents in the bottom right corner of a large web page)

    On Dec 19, 3:48 pm, Randy Webb <> wrote:
    > said the following on 12/19/2007 9:41 AM:
    >
    > > Update: I have seen java script which will scroll down the page
    > > gradually, but I just want to refresh the page and then automatically
    > > focus the user to the bottom right corner without them having to wait.

    >
    > > Thanks for your help in advance!

    >
    > Put an anchor at the bottom of the page, set the hash property on the
    > location. Or, just link directly to the hash.
    >
    > --
    > Randy
    > Chance Favors The Prepared Mind
    > comp.lang.javascript FAQ -http://jibbering.com/faq/index.html
    > Javascript Best Practices -http://www.JavascriptToolbox.com/bestpractices/


    Cheers Randy, very clever!
     
    , Dec 19, 2007
    #5
  6. Guest

    Re: Functionality to scroll into view? (autoamtically scroll tocontents in the bottom right corner of a large web page)

    Thanks for your advice too David
    As the application needs to work across serveral browsers I am going
    to try Randy's simple idea first but might well then look into
    options.
    Cheers
     
    , Dec 19, 2007
    #6
  7. David Mark Guest

    Re: Functionality to scroll into view? (autoamtically scroll tocontents in the bottom right corner of a large web page)

    On Dec 19, 10:05 am, wrote:
    > Thanks for your advice too David
    > As the application needs to work across serveral browsers I am going
    > to try Randy's simple idea first but might well then look into
    > options.


    Randy's suggestion should work fine if you control the content of the
    page. However, if you need it to scroll exactly to the bottom (to the
    pixel), you will probably need to measure and call the scrollTo
    method.

    Also, you should link directly to the hash. Setting the hash on load
    has been known to cause issues with Safari.
     
    David Mark, Dec 19, 2007
    #7
  8. David Mark Guest

    Re: Functionality to scroll into view? (autoamtically scroll tocontents in the bottom right corner of a large web page)

    On Dec 19, 11:28 am, David Mark <> wrote:
    > On Dec 19, 10:05 am, wrote:
    >
    > > Thanks for your advice too David
    > > As the application needs to work across serveral browsers I am going
    > > to try Randy's simple idea first but might well then look into
    > > options.

    >
    > Randy's suggestion should work fine if you control the content of the
    > page. However, if you need it to scroll exactly to the bottom (to the
    > pixel), you will probably need to measure and call the scrollTo
    > method.
    >


    Actually, scratch that. As the browser will always try to put the
    link at the very top, the hash link trick will work. Scrolling all
    the way to the right might be an issue though.
     
    David Mark, Dec 19, 2007
    #8
  9. Guest

    Re: Functionality to scroll into view? (autoamtically scroll tocontents in the bottom right corner of a large web page)

    On Dec 19, 4:32 pm, David Mark <> wrote:
    > On Dec 19, 11:28 am, David Mark <> wrote:
    >
    > > On Dec 19, 10:05 am, wrote:

    >
    > > > Thanks for your advice too David
    > > > As the application needs to work across serveral browsers I am going
    > > > to try Randy's simple idea first but might well then look into
    > > > options.

    >
    > > Randy's suggestion should work fine if you control the content of the
    > > page. However, if you need it to scroll exactly to the bottom (to the
    > > pixel), you will probably need to measure and call the scrollTo
    > > method.

    >
    > Actually, scratch that. As the browser will always try to put the
    > link at the very top, the hash link trick will work. Scrolling all
    > the way to the right might be an issue though.


    Cheers for all your help, using the anchor seemed to work fine. As I
    print a new png image to the page each time it is refreshed, I also
    know the width it is going to be so can simply print <p style="margin-
    left: Image_Widthpx" id="end"/> below the image and use file.php#end
     
    , Dec 20, 2007
    #9
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. csgraham74
    Replies:
    2
    Views:
    408
    csgraham74
    Aug 11, 2005
  2. Nik Coughin

    Div in bottom left corner

    Nik Coughin, Feb 19, 2004, in forum: HTML
    Replies:
    1
    Views:
    3,755
    Nik Coughin
    Feb 20, 2004
  3. ©®
    Replies:
    14
    Views:
    15,115
    Jonathan N. Little
    Nov 4, 2005
  4. J Rice
    Replies:
    2
    Views:
    694
    J Rice
    Jul 25, 2006
  5. Replies:
    0
    Views:
    157
Loading...

Share This Page