Connecting Tech Pros Worldwide Help | Site Map

Reload without moving to the top of the page

  #1  
Old July 20th, 2005, 12:48 PM
Martin RAYROLE
Guest
 
Posts: n/a
Hi folks,

Does somebody know how to reload a page without moving to the top of the
page ?

I have tried the two following commands :
1) window.location=document.location;
2) location.reload();
but, each time, the scrollbar is moved to the top of the page.

Thanks a lot for your help
M@rtin



  #2  
Old July 20th, 2005, 12:48 PM
JimMenees
Guest
 
Posts: n/a

re: Reload without moving to the top of the page


Perhaps with the reload function, you can add window.scrollBy(x,y) or
scrollTo(x,y) to put the user back where they were??
(you could even use a mouse-coordinates detection script to get the exact
location of their 'click' that makes the page reload).

Hope that helps!

Jim
  #3  
Old July 20th, 2005, 12:48 PM
Martin RAYROLE
Guest
 
Posts: n/a

re: Reload without moving to the top of the page


Thanks a lot Jim,

I use it with "window.pageYOffset" or "document.body.scrollTop" (according to
the browser) to store the current scroll position ... and it works well !

Have a good day
Martin

-------------
JimMenees a écrit :
[color=blue]
> Perhaps with the reload function, you can add window.scrollBy(x,y) or
> scrollTo(x,y) to put the user back where they were??
> (you could even use a mouse-coordinates detection script to get the exact
> location of their 'click' that makes the page reload).
>
> Hope that helps!
>
> Jim[/color]

  #4  
Old July 20th, 2005, 12:49 PM
Michael Winter
Guest
 
Posts: n/a

re: Reload without moving to the top of the page


"Martin RAYROLE" wrote on 12/11/2003:
[color=blue]
> Thanks a lot Jim,
>
> I use it with "window.pageYOffset" or "document.body.scrollTop"[/color]
(according to[color=blue]
> the browser) to store the current scroll position ... and it works[/color]
well ![color=blue]
>
> Have a good day
> Martin
>
> -------------
> JimMenees a écrit :
>[color=green]
> > Perhaps with the reload function, you can add window.scrollBy(x,y)[/color][/color]
or[color=blue][color=green]
> > scrollTo(x,y) to put the user back where they were??
> > (you could even use a mouse-coordinates detection script to get[/color][/color]
the exact[color=blue][color=green]
> > location of their 'click' that makes the page reload).
> >
> > Hope that helps!
> >
> > Jim[/color][/color]

What browser(s) have you tested this with? The window.page?Offset
properties return 'undefined' in IE 6.

Mike

--
Michael Winter
M.Winter@[no-spam]blueyonder.co.uk (remove [no-spam] to reply)


Closed Thread