Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-05-2009, 06:09 AM   PM User | #1
crazy.works
Regular Coder

 
Join Date: Jul 2008
Posts: 150
Thanks: 24
Thanked 0 Times in 0 Posts
crazy.works is an unknown quantity at this point
help me with jQuery code Please

hello,
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

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

$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 ??
thanks
crazy.works is offline   Reply With Quote
Old 09-05-2009, 06:40 AM   PM User | #2
crazy.works
Regular Coder

 
Join Date: Jul 2008
Posts: 150
Thanks: 24
Thanked 0 Times in 0 Posts
crazy.works is an unknown quantity at this point
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 ???
crazy.works is offline   Reply With Quote
Old 09-06-2009, 01:47 AM   PM User | #3
crazy.works
Regular Coder

 
Join Date: Jul 2008
Posts: 150
Thanks: 24
Thanked 0 Times in 0 Posts
crazy.works is an unknown quantity at this point
Thanks guys, i fixed it with my own
crazy.works is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:33 PM.


Advertisement
Log in to turn off these ads.