javascript - Using jquery, how to I animate adding a new list item to a list? -


I have a simple JavaScript function that allows me to add a list to a list. Note that I use JQuery ...

  function prepaidlist item (list name, listItemHTML) {// Get list item down ... $ ("#" + listName + "li: first"). SlideDown ("slow"); // Add new item to list ... $ (listItemHTML) .prependTo ("#" + listName)}  

'listName' only one & lt; Ul & gt; with something and 's

Pre-paid work is fine, but I can not get the slide down effect to work. I want to slide the list items down and the new item appears at the top. Any idea how to complete this? I'm still new to JQuery ...

if you want to add it and slide down Do this at the same time:

  functionFendlistItem (list name, listItHtml) {$ (listItemHTML) .hide () Prepaidto ('#' + listName) .Sliddown ('Slow'); } To really do what you describe (slide down,  then  to feed), you want something like this:  

/ P>

  function preendListItem (listName, listItemHTML) {$ (listItemHTML) .hide () .css ('opacity', 0.0) .prependTo ('#' + listName) .slideDown ('slow') .animate ({opacity: 1.0})}  

Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -