Reload without moving to the top of the page

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Martin RAYROLE

    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.locat ion;
    2) location.reload ();
    but, each time, the scrollbar is moved to the top of the page.

    Thanks a lot for your help
    M@rtin



  • JimMenees

    #2
    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

    Comment

    • Martin RAYROLE

      #3
      Re: Reload without moving to the top of the page

      Thanks a lot Jim,

      I use it with "window.pageYOf fset" 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]

      Comment

      • Michael Winter

        #4
        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.pageYOf fset" 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?Off set
        properties return 'undefined' in IE 6.

        Mike

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


        Comment

        Working...