Hi all , I am having <ul> and <li>
on click of li i want to send it at top by animation
Its sending to top successfully but speed is very fast
I wants that it should go with very slow speed.
I tried all approaches but not get any success
My code is
$('li.new-item').click(function () {
// the clicked LI
var clicked = $(this);
// all the LIs above the clicked one
var previousAll = clicked.prevAll();
// only proceed if it's not already on top (no previous siblings)
if (previousAll.length > 0) {
clicked.css('position', 'relative');
previousAll.css('position', 'static');
clicked.animate({ top: "-30px" }).delay(500);
previousAll.animate({ 'top': 38 }, { complete: function () {
// rearrange the DOM and restore positioning when we're done moving
clicked.parent().prepend(clicked);
clicked.css({ 'position': 'static', 'top': 0 });
previousAll.css({ 'position': 'static', 'top': 0 });
}
});
}
});
Please help me