Consider the following example I made here:
$("#add").click(function() {
$("#wrap ul").append('<li class="new">Teste</li>');
$("li.new").slideDown('slow', 'easeOutBounce');
});
How can you fix it by clicking on the add
button? jQuery creates a new li
element in my list .. So far so good .. Note that I set max-height
and overflow: auto
with%. The problem is that by adding multiple elements within my list, the wrap
scroll bar stays in the middle of it, instead of remaining in wrap
as I would like .. So my question is this, how would I do to that when a new element is added the scrollbar 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).