save jquery ui-sortable positions to DB

前端 未结 4 608
北恋
北恋 2020-12-24 00:53

Im trying to replicate the functionality of this page (http://www.kissfm.ro/fresh-top-40/) for a friend who has a small web radio. The site is setup in wordpress fyi.

<
4条回答
  •  忘掉有多难
    2020-12-24 01:15

    You may POST with input  to DB and save it
    Here we go:
    
    • . .
    $(document).ready(function(){ $('#sortable').sortable({ update: function(event, ui) { var newOrder = $(this).sortable('toArray').toString(); $.get('saveSortable.php', {order:newOrder}); } }); });

    Hope it helps ;)

提交回复
热议问题