作者:mis安小米 | 来源:互联网 | 2013-05-16 08:42
看到一个不错的jquery插件,可拖动DIV,顺序可保存到数据库的一个实例:这里就以其中PHP实例简单说明一下:
//post到后台的数据
if ($_POST) {
$ids = $_POST["ids"];
for ($idx = 0; $idx
$id = $ids[$idx];
$ordinal = $idx;
//...
}
return;
}
?>
jQuery List DragSort PHP Example
Homepage
Save list order with ajax:
$list = array("blue", "orange", "brown", "red", "yellow", "green", "black", "white", "purple");
for ($idx = 0; $idx
echo "- ";
echo "" . $list[$idx] . "
";
echo " ";
}
?>