jQuery Sortable with animation

前端 未结 5 1493
一向
一向 2020-12-07 18:23

I\'m using jQuery and Sortable to arrange my list of items (and this http://dragsort.codeplex.com).

All works perfect.

I\'m using a function on dragEnd

5条回答
  •  死守一世寂寞
    2020-12-07 18:30

    While this solution works great to create an initial transition, when the item snaps back, there is no transition. The solution is easier than I ever expected. All you need to do is adjust the revert option in .sortable()

    Like this:

         
    

    jQuery UI API: http://api.jqueryui.com/sortable/#option-revert

    This makes a nice and smooth transition to the item's new home.

    Click here for EXAMPLE on jsFiddle

提交回复
热议问题