Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jul 2008
    Posts
    150
    Thanks
    24
    Thanked 0 Times in 0 Posts

    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

    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

  • #2
    Regular Coder
    Join Date
    Jul 2008
    Posts
    150
    Thanks
    24
    Thanked 0 Times in 0 Posts
    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 ???

  • #3
    Regular Coder
    Join Date
    Jul 2008
    Posts
    150
    Thanks
    24
    Thanked 0 Times in 0 Posts
    Thanks guys, i fixed it with my own


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •