scroll-position

Browser does not remember position of page last viewed

て烟熏妆下的殇ゞ 提交于 2019-12-18 13:31:46
问题 I have done a few searches for this issue and I have come up empty handed. I hope somebody can clarify things for me and point me in the right direction. Problem: I have a page that displays a list of results after submitting a search form. When a user clicks on one of the results, the browser goes to a new page showing more information about the result. When the user then clicks the 'back' button to go pack to the results, my browser reloads the page and shows the top of the page instead of

Scroll Position of div with “overflow: auto”

佐手、 提交于 2019-12-17 09:39:09
问题 Given this HTML snippet: <div id="box" style="overflow:auto; width:200px; height:200px; border:1px solid black;"> 1<br>2<br>3<br>4<br>5<br>6<br>7<br>8<br>9<br>10<br> 11<br>12<br>13<br>14<br>15<br>16<br>17<br>18<br>19<br>20<br> 21<br>22<br>23<br>24<br>25<br>26<br>27<br>28<br>29<br>30<br> </div> You (usually) get a black box with a scrollbar that contains the numbers 1 to 30, each in a new row. You can scroll up and down inside of that box. What I need now is a possibility to find out, at which

Store and restore RecyclerView position not working

安稳与你 提交于 2019-12-11 06:08:32
问题 I am using GridLayoutManager as LayoutManager for RecyclerView inside a fragment , and RecyclerView adapter get populated by loader. I tried to store and restore state of GridLayoutManager on device rotation but not working and still get back to the initial state "first element in RecyclerView". onSaveInstanceState method: @Override public void onSaveInstanceState(Bundle outState) { mRecylcerViewParecelable = mGridView.getLayoutManager().onSaveInstanceState(); outState.putParcelable(GRID

Update scroll position on resize of window

前提是你 提交于 2019-12-08 12:18:24
问题 I'm currently using a combination of smooth scroll and IDs/anchor tags to scroll to content on my site. The code below is getting the ID of the next 'section' in the DOM, and adding it's ID as the 'view next section' href, so once it's clicked, it'll scroll to the top of that div. Then, it iterates through, updating the href with the next ID each time etc until the last section is seen and it scrolls back to the top. Pretty straightforward. The only problem is that the 'sections' are

How to get scroll position for RichTextBox?

谁说我不能喝 提交于 2019-12-02 11:39:25
问题 I'm working in C#, Windows Forms application, and have a problem getting scroll position for RichTextBox with large amount of text. I'm using this code: public class POINT { public int x; public int y; public POINT() { } public POINT(int x, int y) { this.x = x; this.y = y; } } SendMessage(this.Handle, EM_GETSCROLLPOS, 0, res) But, when control contains large amount of text, resulting y offset is incorect because upper 16 bits of Y are always 0. Is there any way to get scroll position larger

How to get scroll position for RichTextBox?

一曲冷凌霜 提交于 2019-12-02 07:23:30
I'm working in C#, Windows Forms application, and have a problem getting scroll position for RichTextBox with large amount of text. I'm using this code: public class POINT { public int x; public int y; public POINT() { } public POINT(int x, int y) { this.x = x; this.y = y; } } SendMessage(this.Handle, EM_GETSCROLLPOS, 0, res) But, when control contains large amount of text, resulting y offset is incorect because upper 16 bits of Y are always 0. Is there any way to get scroll position larger than 16 bits? I thought it was about time to case this into an answer GetPositionFromCharIndex(0)

Update SimpleCursorAdapter while maintaining scroll position in ListView

江枫思渺然 提交于 2019-11-30 15:00:56
问题 My problem: My ListView resets its scroll position to the top whenever I update its contents through its (customized) SimpleCursorAdapter. I would like the ListView to maintain its scroll position when updated. I started out by creating a new adapter instance every time and using ListView.setAdapter() , but according to this discussion I should be updating the adapter instead of resetting it. I can't find a way to do this for SimpleCursorAdapter that works correctly. Here are some things I've

Browser does not remember position of page last viewed

烈酒焚心 提交于 2019-11-30 09:57:42
I have done a few searches for this issue and I have come up empty handed. I hope somebody can clarify things for me and point me in the right direction. Problem: I have a page that displays a list of results after submitting a search form. When a user clicks on one of the results, the browser goes to a new page showing more information about the result. When the user then clicks the 'back' button to go pack to the results, my browser reloads the page and shows the top of the page instead of the result that was last clicked. Goal: What I would like is this: when the user click's the back

Maintain scroll position of a div within a page on postback

两盒软妹~` 提交于 2019-11-28 21:38:20
I have a div within an aspx page with overflow set to auto. The contents of the div are dynamically created and consists of a list of link buttons. <div id="div1" style="overflow: auto; height: 100%;"> ..... </div> When I scoll down in the div and click on any of the link buttons, the page reload loses the scroll position inside the div and takes me to the top of the div. Is there any way to prevent that? Note that this is for a div inside the page. Page.MaintainScrollPositionOnPostBack() does not work. As Jeff S mentioned one way to handle this situation is using javascript to track the

Get current scroll position and pass it as a variable with a link?

坚强是说给别人听的谎言 提交于 2019-11-28 18:48:49
I'll be honest, I'm way out of my depth here. I've created a pagination system where you click on a link it reloads the page and a certain number of list items are shown in an unordered list. When you click it again it'll reload the page and more items showing. Think how Twitter shows the tweets in your feed. The problem is when it reloads the page it stays at the top. What I would like is for it to jump to the same position on the page it previously had. I already have a selector for the link set up fine I just don't know how to get the current scroll position and then pass it to the new page