2


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 ?

user3455363
  • 408
  • 1
  • 5
  • 13

1 Answers1

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