View Full Version : help me with jQuery code Please

09-05-2009, 07:09 AM
i am doing animated display list, so lets say inside the list will be 6 <li>, with the jQuery i will hide 2 and i will display only 4 elements.
and after that i will animate the elements with scroll effect, so the <li> elements will be changed every couple of seconds, one element will disappear and then another one will be inserted and displayed .

now i got problem with the part which inserting new element, and here is my code

var $insert = $(items[currentItem]).css({
height : 0,
opacity : 0,
display : 'none'

$insert.animate({ height : height }).animate({ opacity :1 });

so with this code i insert new <li> element with the $insert variable as you see in my code.

every thing in the code works fine, but my problem is i don't know how to determine the position of the new inserted <li> element, i mean it always get inserted in the top of the list, and i want to insert the new element in the bottom of the list

so please how can i edit this to insert the new element in the bottom of the list ??

09-05-2009, 07:40 AM
maybe the problem is prependTo and that is why it insert the new element at the beginning of the list each time ???
how can i reverse prependTo to insert the element at the end of the list ???

09-06-2009, 02:47 AM
Thanks guys, i fixed it with my own :)