javascript - Set focus to the end of table inside of div when adding a new row -


I have a table inside a div with the set height, when the table is bigger than div, scroll bar Appears. The problem is that if the div's scroll bar is at the top, leaving the second row hidden below, and the user presses the button to add a new line, then this row is added to the table below, so you can Check it out.

Is it designed with Javascript, VBSPPTi or CSS anyway, so that it has been created so that it is visible when it is added?

This is the code where the task will be called to add a new row.

  strRow = strRow + "
gt; & lt; / div & gt; "

Any help appreciated Will go.

PD: I think it should be on VBScript or Javascript, not JQuery please.

Thank you.

Try Element.scrollIntoView (); It works in Firefox, IE 6+, Opera and Google Chrome / Safari.

You can also provide a boolean for the function, in which it will specify how to scroll the element:

  // Element.scrollIntoView (the original element) ) Align the element with the top; Element.scrollIntoView (true); // Element.scrollIntoView (false) align the element below;  

Edit: For scrolling down

with scrollIntoView , you can see the element's scrollTop To equal the property to scrollHeight property:

  Element.scrollTop = Element.scrollHeight;  

Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -