JQuery Giving a DIV by pushing it down
$('#container').prepend("<ul><li>Stuff</li></ul>').hide().slideDown(); I want the NEW UL to slide down. but the above slides all over the # container.
How can I add an element to the top and then move it down. Like Twitter used to display your new tweet.
Thanks.
+6
user479959
source share1 answer
Instead, you can try using this syntax:
$('<ul><li>Stuff</li></ul>').prependTo('#container').hide().slideDown(); Of course, if you use such a list, it may be useful to create its element by element as follows:
var ul = $('<ul />').prependTo('#container'); $('<li />').appendTo(ul).text('Incoming!').hide().slideDown(); +22
Yi jiang
source share