To jump to an element, you can use .animate () .
Here is an example of a function that scrolls into a jQuery selector (e.g. ID):
function goToByScroll(selector){
$('html,body').animate({
scrollTop: $(selector).offset().top},
'slow');
}
You can run this function whenever necessary. For example, immediately after adding this element:
$("#parent").append("<li id='nthItem'>blah</li>");
goToByScroll("#nthItem");
Finally, to select idin jQuery, use
$("#nthItem")
not
$("nthItem")