Connecting Tech Pros Worldwide Help | Site Map

Reload without moving to the top of the page

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 20th, 2005, 11:48 AM
Martin RAYROLE
Guest
 
Posts: n/a
Default Reload without moving to the top of the page

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, 11:48 AM
JimMenees
Guest
 
Posts: n/a
Default 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, 11:48 AM
Martin RAYROLE
Guest
 
Posts: n/a
Default 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, 11:49 AM
Michael Winter
Guest
 
Posts: n/a
Default 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)


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.