Opengist

Explore

  • All gists
  • Topics
  • Users
Give feedback on the new UI Powered by Opengist ⋅ 165ms

user:thomas gists created by user

title:mygist gists with given title

description:sync gists with given description

filename:myfile.txt gists having files with given name

extension:yml gists having files with given extension

language:go gists having files with given language

topic:homelab gists with given topic

all:systemctl search all fields

Login
n

nested-list

Recently created Least recently created Recently updated Least recently updated

timmy / SortableJS 巢狀清單拖放排序

Last active 5 hours ago dom-manipulation drag-and-drop html javascript nested-list sortablejs ui-interaction

本範例展示如何使用 SortableJS 實現可拖放的巢狀清單,允許用戶調整層級結構與順序,適用於 層級式資料管理、分類管理、階層式 UI 排序 等應用。

0 0 0 1
1 <!DOCTYPE html>
2 <html lang="zh-TW">
3 <head>
4 <meta charset="UTF-8">
5 <meta name="viewport" content="width=device-width, initial-scale=1.0">
6 <title>SortableJS 巢狀清單</title>
7 <style>
8 .nested-list {
9 list-style: none;
10 padding-left: 20px;