11
Consider the following example I’ve done here:
$("#add").click(function() {
$("#wrap ul").append('<li class="new">Teste</li>');
$("li.new").slideDown('slow', 'easeOutBounce');
});
http://jsfiddle.net/Wagner/4FQCK/5
As you can see by clicking the button add
jQuery creates a new element li
on my list.. So far so good.. Note that I have defined a max-height
and a overflow: auto
in my element wrap
. The problem is that by adding multiple elements within my list, the scroll bar of wrap
is in the middle of it, rather than staying in the bottom
how I’d like. So my question is this, how would I make it so that when a new element is added the scroll bar does not go up (remembering that the user should still have the option to scroll the bar up if he wants to see other items in the list).
Damn it, I used the original fiddle of the question to go testing, and then when it came to doing mine, I forgot to add the libraries being used... what a mess! Thanks @Sergio for your comment!
– Miguel Angelo
This was something that occurred to me... I was going to try to see if it had how to do using an anchor at the end of all UL’s. And ended up staying there unintentionally.
– Miguel Angelo