In my application I have displayed records in div that is set to overflow : auto.
The task I'am trying to accomplish is: After by clicking button adding new record to database, reload page and if content of my div is in overflow mode i would like to scrool down to bottom of that div.
Also in my code behind after adding record i can obtain id of control that represents new record.
I'am using framework 1.1
What steps/tehniques should I use to accomplish that task ?
Asked
Active
Viewed 3,750 times
2

user3455363
- 408
- 1
- 5
- 13
-
you might want to try `overflow: scroll;` – Scott Apr 14 '14 at 14:04
-
I think you wanna when you scroll the mouse then display the data does i make sense or not? – Nayeem Mansoori Apr 14 '14 at 14:04
-
http://stackoverflow.com/questions/3742346/use-jquery-to-scroll-to-the-bottom-of-a-div-with-lots-of-text – Aamir Afridi Apr 14 '14 at 14:04
1 Answers
3
You can scroll to the last item with the function scrollIntoView. For exemple, if your div's id is "content" and your elements are 'p' :
var elements = document.getElementById('content').getElementsByTagName('p');
elements[elements.length - 1].scrollIntoView();

Camille Wintz
- 951
- 7
- 8