javascript - Jquery make div always scroll to bottom -


i have div contains table. table dynamically updated, , filling data user using our website. possible force div scrolled bottom? user able see bottom table row added. thank you!

that like

...onrowadded = function() {     $('#mytable').animate({scrolltop: $('#mytable').attr('scrollheight')}); }; 

note, if rows added often, want use settimeout blocking variable check @ beginning prevent scrolling down more twice per second or so. technique discussed e.g. here

update

starting jquery 1.6 better use .prop() instead of .attr() (see comments question):

onrowadded = function() {     $('#mytable').animate({scrolltop: $('#mytable').prop('scrollheight')}); }; 

Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -