Scroll position lost when hiding div

后端 未结 2 690
隐瞒了意图╮
隐瞒了意图╮ 2021-01-19 02:33

http://jsfiddle.net/cbp4N/16/

If you show the div. Change the scroll position and then hide and show it agian the scroll position is lost.

am I doing anythi

2条回答
  •  南笙
    南笙 (楼主)
    2021-01-19 02:36

    This is normal behaviour because the element is set to the least possible variables to memory when you hide it. If you want to remember scroll position you'll have to store those yourself and then apply the scroll position on showing it.

    Scroll Position of div with "overflow: auto"

提交回复
热议问题