Sunday, 15 April 2012

javascript - jQuery UI Sortable events - click and send to the end -



javascript - jQuery UI Sortable events - click and send to the end -

i need help jquery ui sortable script. how can send item lastly item on list?

<ul id="drag"> <li> first <div>x</div> </li> <li> sec <div>x</div> </li> <li> 3rd <div>x</div> </li> <li> 4th <div>x</div> </li> </ul>

my js:

$(document).on('click', '#drag div', function(e) { var item = $(this).closest('li'); // send `item` end of list... });

how can ?

this should trick

$('#drag').sortable(); $(document).on('click', '#drag div', function (e) { $(this).parent().appendto('#drag'); });

http://jsfiddle.net/7pdav/

you take , re-append clicked item. append set @ end.

javascript jquery jquery-ui events sortable

No comments:

Post a Comment