1

I have div with absolute positioning

<div style:position: absolute; left:50px; overflow: auto; top:200px; right:100px; bottom:25px;>

Above it there is a logo etc.

But if div scrolled down and page is refreshed, the scroll of this div goes at the top of the div.

Is there any method to keep div in previous position after page's refresh?

el Dude
  • 5,003
  • 5
  • 28
  • 40
  • @Stilly.stack is it possible to achieve it with `` tag? I mean, when it's with absolute positioning and surrounded with other elements – el Dude May 03 '14 at 19:17

1 Answers1

2

please read this : How to get scrollbar position with Javascript?

Method 1 and then consider to store a cookie with the scrollbar position.

Method 2 or store the value server side in a visitors table on base of the IP

There is one more funny way.

Method 3 use anchors like <a name="foo"> and send your post action to the URL containing the anchor like this <form action="site.php#foo" ... Its not so exact like the cookie version but it works somehow :))

Community
  • 1
  • 1
  • 2
    I'm looking for html/css solution (( – el Dude May 03 '14 at 19:16
  • 1
    with html, css it is not possible afaik –  May 03 '14 at 19:18
  • 2
    is it possible to achieve it with tag? I mean, when it's with absolute positioning and surrounded with other elements – el Dude May 03 '14 at 19:20
  • 2
    I do not think so. But html5 may offer a possibility that I do not know. AFAIK even html5 is not able to read out css values and set css values dynamically. –  May 03 '14 at 19:27