I saw a good jquery plug-in that can drag DIVs and save the order to an instance of the database: Here is a brief explanation of the PHP example:
//Post data to the background
if ($_POST) {
$ids = $_POST["ids"];
for ($idx = 0; $idx < count($ids); $idx =1) {
$id = $ids[$idx ];
$ordinal = $idx;
//...
>
Copy code
The code is as follows:
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 < count($list); $idx =1) {
echo "- ";
echo "" . $list[$idx] . "
";
echo " ";
}
?>
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn