Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Javascript (http://www.velocityreviews.com/forums/f68-javascript.html)
-   -   Functionality to scroll into view? (autoamtically scroll to contentsin the bottom right corner of a large web page) (http://www.velocityreviews.com/forums/t933976-functionality-to-scroll-into-view-autoamtically-scroll-to-contentsin-the-bottom-right-corner-of-a-large-web-page.html)

crazychrisy54@hotmail.com 12-19-2007 02:09 PM

Functionality to scroll into view? (autoamtically scroll to contentsin the bottom right corner of a large web page)
 
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

crazychrisy54@hotmail.com 12-19-2007 02:41 PM

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!

David Mark 12-19-2007 02:58 PM

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


crazychris...@hotmail.com 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.

crazychrisy54@hotmail.com 12-19-2007 03:02 PM

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 <HikksNotAtH...@aol.com> wrote:
> crazychris...@hotmail.com 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!

crazychrisy54@hotmail.com 12-19-2007 03:02 PM

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 <HikksNotAtH...@aol.com> wrote:
> crazychris...@hotmail.com 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!

crazychrisy54@hotmail.com 12-19-2007 03:05 PM

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

David Mark 12-19-2007 04:28 PM

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, crazychris...@hotmail.com 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 12-19-2007 04:32 PM

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 <dmark.cins...@gmail.com> wrote:
> On Dec 19, 10:05 am, crazychris...@hotmail.com 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.

crazychrisy54@hotmail.com 12-20-2007 08:28 AM

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 <dmark.cins...@gmail.com> wrote:
> On Dec 19, 11:28 am, David Mark <dmark.cins...@gmail.com> wrote:
>
> > On Dec 19, 10:05 am, crazychris...@hotmail.com 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


All times are GMT. The time now is 09:41 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.