Just use what's in the article, and modify the value that goes into this line:
var targetOffset = $(this.hash).offset().top; with something like: var offset = 0 - Math.round( $(window).height() / 2 ); var targetOffset = $(this.hash).offset().top - offset; > I avoid using scrollTo because I wanna have #about in the url so that > i can refer to specific part of my page. > So I didn't use scrollTo plugin but using the mothed posted from here: > http://www.zachstronaut.com/posts/2009/01/18/jquery-smooth-scroll-bugs.html > > Do u have any idea that i can still using location.hash? > > thanks On Mar 9, 11:58 pm, James <james.gp....@gmail.com> wrote: > Try using the ScrollTo > plugin:http://flesler.blogspot.com/2007/10/jqueryscrollto.html > > Use the anchor/div element as the element to scroll to, and calculate > the offset (based on height of a user's viewport) so the it'll scroll > to somewhere just above that, leaving the element in the center. > > On Mar 9, 11:50 am, mangajin <sushisupers...@gmail.com> wrote: > > > Hi, > > > Normally when we have this url :www.mypage.html#aboutt, the browser > > will jump to the area that anchor or div element has #about. By > > default the browser will show that anchor or div at the top most of > > the page. Are there any ways in jQuery that show that specific anchor > > in the middle of bottom of the page? > > > Thanks On Mar 9, 12:58 pm, James <james.gp....@gmail.com> wrote: > Try using the ScrollTo > plugin:http://flesler.blogspot.com/2007/10/jqueryscrollto.html > > Use the anchor/div element as the element to scroll to, and calculate > the offset (based on height of a user's viewport) so the it'll scroll > to somewhere just above that, leaving the element in the center. > > On Mar 9, 11:50 am, mangajin <sushisupers...@gmail.com> wrote: > > > Hi, > > > Normally when we have this url :www.mypage.html#aboutt, the browser > > will jump to the area that anchor or div element has #about. By > > default the browser will show that anchor or div at the top most of > > the page. Are there any ways in jQuery that show that specific anchor > > in the middle of bottom of the page? > > > Thanks > >