{"id":16744,"date":"2013-03-25T21:01:05","date_gmt":"2013-03-25T13:01:05","guid":{"rendered":"https:\/\/www.hongkiat.com\/blog\/?p=16744"},"modified":"2025-04-04T01:30:28","modified_gmt":"2025-04-03T17:30:28","slug":"jquery-ui-sortable","status":"publish","type":"post","link":"https:\/\/www.hongkiat.com\/blog\/jquery-ui-sortable\/","title":{"rendered":"Web Design: Drag and Drop with jQuery UI Sortable"},"content":{"rendered":"<p>We have covered how to give custom style to <a href=\"https:\/\/jqueryui.com\/\" rel=\"nofollow\">jQuery UI<\/a>, starting from the UI Accordion, <a href=\"https:\/\/www.hongkiat.com\/blog\/jquery-volumn-slider\/\">UI Slider<\/a> and the <a href=\"https:\/\/www.hongkiat.com\/blog\/jquery-ui-datepicker\/\">UI Date Picker<\/a>. Today we will continue our exploration on jQuery UI in theming <a href=\"https:\/\/jqueryui.com\/sortable\/\" rel=\"nofollow\">jQuery UI Sortable<\/a>.<\/p>\n<p>This particular plugin will enable a group of DOM to be sortable, meaning that we are able to move the object from one to another position. The following is how the final result will look like.<\/p>\n<p>Let\u2019s just get started.<\/p>\n<h2>Step 1: Preparing Essential Files<\/h2>\n<p>Before we start working on the code, we need to prepare a few essential things, including: the <a href=\"https:\/\/jquery.com\/\" rel=\"nofollow\">jQuery<\/a>, the <a href=\"https:\/\/jqueryui.com\/\" rel=\"nofollow\">jQuery UI<\/a> library, and the <a href=\"https:\/\/fortawesome.github.com\/Font-Awesome\/\" rel=\"nofollow\">FontAwesome<\/a> to deliver the icon we are going to use later on.<\/p>\n<p>For the jQuery and the jQuery UI library, you don\u2019t have to host them on your own, the better, practical way is to link them from CDN, as follow:<\/p>\n<pre>\r\n&lt;script src=\"http:\/\/code.jquery.com\/jquery-1.8.2.js\"&gt;&lt;\/script&gt;\r\n&lt;script src=\"http:\/\/code.jquery.com\/ui\/1.9.1\/jquery-ui.js\"&gt;&lt;\/script&gt;\r\n<\/pre>\n<p>Put those scripts inside the &lt;head&gt; or before the closing body tag for better load performance.<\/p>\n<p>Furthermore, we will not use the default styles that come with jQuery UI, so we need to create a new CSS file to store our custom styles and then link it to our document, as follows.<\/p>\n<pre>\r\n&lt;link rel=\"stylesheet\" href=\"style.css\" \/&gt;\r\n<\/pre>\n<p>This next step is optional, you can leave is you want to. But, I prefer to normalize all the default DOM styles with noremalize.css or else you can also use <a href=\"https:\/\/meyerweb.com\/eric\/tools\/css\/reset\/\">CSS Reset<\/a> from Eric Mayer.<\/p>\n<p>Put this line inside the head before the style.css we have created previously.<\/p>\n<pre>\r\n&lt;link rel=\"stylesheet\" href=\"https:\/\/github.com\/necolas\/normalize.css\/2.0.1\/normalize.css\"&gt;\t\r\n<\/pre>\n<p>To sum up, here are all the files we link through inside the <code>&lt;head&gt;<\/code> tag.<\/p>\n<pre>\r\n&lt;link rel=\"stylesheet\" href=\"https:\/\/github.com\/necolas\/normalize.css\/2.0.1\/normalize.css\"&gt;\r\n&lt;link rel=\"stylesheet\" href=\"style.css\" \/&gt;\r\n&lt;script src=\"http:\/\/code.jquery.com\/jquery-1.8.2.js\"&gt;&lt;\/script&gt;\r\n&lt;script src=\"http:\/\/code.jquery.com\/ui\/1.9.1\/jquery-ui.js\"&gt;&lt;\/script&gt;\r\n<\/pre>\n<p class=\"note\"><strong>Recommended Reading:<\/strong> <a href=\"https:\/\/www.hongkiat.com\/blog\/css-priority-level\/\">Reviewing CSS Priority Level<\/a><\/p>\n<h2>Step 2: HTML Structure<\/h2>\n<p>The HTML structure for jQuery UI Sortable is quite flexible. We can use a <code>&lt;div&gt;<\/code> or <code>&lt;dt&gt;<\/code>, as long as we wrap them inside a parent element with specific id attribute.<\/p>\n<p>And in our case, we are going to use the <code>&lt;li&gt;<\/code> tag. Put all the HTML shown below inside the <code>&lt;body&gt;<\/code>.<\/p>\n<pre>\r\n&lt;ul id=\"sortable\"&gt;\r\n    &lt;li class=\"ui-state-default\"&gt;Item 1&lt;\/li&gt;\r\n    &lt;li class=\"ui-state-default\"&gt;Item 2&lt;\/li&gt;\r\n    &lt;li class=\"ui-state-default\"&gt;Item 3&lt;\/li&gt;\r\n    &lt;li class=\"ui-state-default\"&gt;Item 4&lt;\/li&gt;\r\n    &lt;li class=\"ui-state-default\"&gt;Item 5&lt;\/li&gt;\r\n    &lt;li class=\"ui-state-default\"&gt;Item 6&lt;\/li&gt;\r\n    &lt;li class=\"ui-state-default\"&gt;Item 7&lt;\/li&gt;\r\n&lt;\/ul&gt;\r\n<\/pre>\n<h2>Step 3: Activating UI Sortable<\/h2>\n<p>The id attribute that is attached on the parent element, as shown in the above code snippet, is important. This <strong>id<\/strong> is used for activating the DOM element to jQuery UI. To do so, put all the following script inside the <code>&lt;head&gt;<\/code> tag, right after all the other scripts we have added before.<\/p>\n<pre>\r\n&lt;script&gt;\r\n    $(function() {\r\n        $( \"#sortable\" ).sortable({ \r\n            placeholder: \"ui-sortable-placeholder\" \r\n        });\r\n    });\r\n&lt;\/script&gt;\r\n<\/pre>\n<p>At this point, the UI Sortable should already work. You can click, hold, drag them top to bottom or vice versa. However, the presentation still looks white and plain.<\/p>\n<h2>Step 4: Defining New Font Family<\/h2>\n<p>As we mentioned earlier, we will need FontAwesome to deliver an icon. <a href=\"https:\/\/fortawesome.github.com\/Font-Awesome\/\" rel=\"nofollow\">Download the package here<\/a>, extract it and place all the fonts under a folder named <strong>font<\/strong>. And put these lines inside the <code>style.css<\/code> to define new font family in our web document, <strong>FontAwesome<\/strong>.<\/p>\n<pre>\r\n@font-face {\r\n  font-family: \"FontAwesome\";\r\n  src: url('font\/fontawesome-webfont.eot');\r\n  src: url('font\/fontawesome-webfont.eot?#iefix') format('eot'), \r\n  \t   url('font\/fontawesome-webfont.woff') format('woff'), \r\n  \t   url('font\/fontawesome-webfont.ttf') format('truetype'), \r\n  \t   url('font\/fontawesome-webfont.svg#FontAwesome') format('svg');\r\n  font-weight: normal;\r\n  font-style: normal;\r\n}\r\n<\/pre>\n<h2>Step 5: Styling The UI Sortable<\/h2>\n<p>In this step, we will start off styling the UI Sortable by adding background color for the body tag as follows:<\/p>\n<pre>\r\nbody {\r\n\tbackground-color: #333;\r\n}\r\n<\/pre>\n<p>Then, we specify the fix width of the UI Sortable, position it at the center of browser window as well as add  some gimmicks, like so:<\/p>\n<pre>\r\n.ui-sortable {\r\n\twidth: 350px;\r\n\tmargin: 50px auto;\r\n\tbackground-color: #ccc;\r\n\t-webkit-box-shadow:  0px 0px 10px 1px rgba(0, 0, 0, .1);\r\n  box-shadow:  0px 0px 10px 1px rgba(0, 0, 0, .1);\r\n  list-style-type: none; \r\n  padding: 0; \r\n}<\/pre>\n<p>At this point, our UI Sortable will look like this screenshot below.<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/jquery-ui-sortable\/preview-one.jpg\" alt=\"preview\" width=\"500\" height=\"280\"><\/figure>\n<h2>UI Default State<\/h2>\n<p>Next we will add the default styles for the <code>&lt;li&gt;<\/code> elements. These styles consist of the background gradient colors, the length of the elements, the borders, the text styles and specifically remove the border for the first child and the last child of the <code>&lt;li&gt;<\/code>.<\/p>\n<pre>\r\n.ui-sortable li.ui-state-default { \r\n\tmargin: 0; \r\n\theight: 45px;\r\n\tline-height: 48px;\r\n\tfont-size: 1.4em; \r\n\tcolor: #fff;\r\n\toutline: 0;\r\n\tpadding: 0;\r\n\tmargin: 0;\r\n\ttext-indent: 15px;\r\n\tbackground: rgb(78,82,91);\r\n\tbackground: -moz-linear-gradient(top,  rgb(78,82,91) 0%, rgb(57,61,68) 100%);\r\n\tbackground: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgb(78,82,91)), color-stop(100%,rgb(57,61,68)));\r\n\tbackground: -webkit-linear-gradient(top,  rgb(78,82,91) 0%,rgb(57,61,68) 100%);\r\n\tbackground: -o-linear-gradient(top,  rgb(78,82,91) 0%,rgb(57,61,68) 100%);\r\n\tbackground: -ms-linear-gradient(top,  rgb(78,82,91) 0%,rgb(57,61,68) 100%);\r\n\tbackground: linear-gradient(to bottom,  rgb(78,82,91) 0%,rgb(57,61,68) 100%);\r\n\tborder-top: 1px solid rgba(255,255,255,.2);\r\n\tborder-bottom: 1px solid rgba(0,0,0,.5);\r\n\ttext-shadow: -1px -1px 0px rgba(0,0,0,.5);\r\n\tfont-size: 1.1em;\r\n\tposition: relative;\r\n\tcursor: pointer;\r\n}\r\n.ui-sortable li.ui-state-default:first-child {\r\n\tborder-top: 0; \r\n}\r\n.ui-sortable li.ui-state-default:last-child {\r\n\tborder-bottom: 0;\r\n}<\/pre>\n<p>After adding those colors, our UI will start looking better, as shown in the following screenshot.<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/jquery-ui-sortable\/preview-two.jpg\" alt=\"preview\" width=\"500\" height=\"280\"><\/figure>\n<h2>Placeholder<\/h2>\n<p>No, this is not the Placeholder <a href=\"https:\/\/www.hongkiat.com\/blog\/building-html5-css-webpages\/\">attribute for HTML5<\/a>. The placeholder in jQuery UI refers to the blank spaces where the DOM element can be placed on. In this case, we will add this area with grey background and dashed border, like so.<\/p>\n<pre>\r\n.ui-sortable-placeholder {\r\n\tborder: 3px dashed #aaa;\r\n\theight: 45px;\r\n\twidth: 344px;\r\n\tbackground: #ccc;\r\n}<\/pre>\n<p>Now, when you try to replace the DOM position you should see the area as shown in this screenshot below.<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/jquery-ui-sortable\/ui-placeholder.jpg\" alt=\"placeholder\" width=\"500\" height=\"280\"><\/figure>\n<h2>\u201cMovable\u201d Icon<\/h2>\n<p>Lastly we will add an icon to the <code>&lt;li&gt;<\/code> to show that it is movable. To do so, we will add this icon through the <code>:after<\/code> <em>pseudo-element<\/em> and assign FontAwesome font family exclusively.<\/p>\n<pre>\r\n.ui-sortable li.ui-state-default:after {\r\n\tcontent: \"\\f0c9\";\r\n\tdisplay: inline-block;\r\n\tfont-family: \"FontAwesome\";\r\n\tposition: absolute;\r\n\tright: 18px;\r\n\ttop: 9px;\r\n\ttext-align: center;\r\n\tline-height: 35px;\r\n\tcolor: rgba(255,255,255,.2);\r\n\ttext-shadow: 0px 0px 0px rgba(0,0,0,0);\r\n\tcursor: move;\r\n}<\/pre>\n<p>That\u2019s all the codes we need. Finally you can view the demo and examine the source code through the following links. We hope you enjoyed this tutorial.<\/p>\n<ul class=\"download download-2c\">\n<li><a target=\"_blank\" href=\"https:\/\/hongkiat.github.io\/jquery-ui-sortable\/\" rel=\"noopener noreferrer\">Demo<\/a><\/li>\n<li><a target=\"_blank\" href=\"https:\/\/github.com\/hongkiat\/jquery-ui-sortable\/\" rel=\"noopener noreferrer\">Download Source Code<\/a><\/li>\n<\/ul>","protected":false},"excerpt":{"rendered":"<p>We have covered how to give custom style to jQuery UI, starting from the UI Accordion, UI Slider and the UI Date Picker. Today we will continue our exploration on jQuery UI in theming jQuery UI Sortable. This particular plugin will enable a group of DOM to be sortable, meaning that we are able to&hellip;<\/p>\n","protected":false},"author":113,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3392,3395],"tags":[3064,911],"topic":[4520],"class_list":["entry-content","is-maxi"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v22.8 (Yoast SEO v27.5) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Web Design: Drag and Drop with jQuery UI Sortable - Hongkiat<\/title>\n<meta name=\"description\" content=\"We have covered how to give custom style to jQuery UI, starting from the UI Accordion, UI Slider and the UI Date Picker. Today we will continue our\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.hongkiat.com\/blog\/jquery-ui-sortable\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Web Design: Drag and Drop with jQuery UI Sortable\" \/>\n<meta property=\"og:description\" content=\"We have covered how to give custom style to jQuery UI, starting from the UI Accordion, UI Slider and the UI Date Picker. Today we will continue our\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.hongkiat.com\/blog\/jquery-ui-sortable\/\" \/>\n<meta property=\"og:site_name\" content=\"Hongkiat\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/hongkiatcom\" \/>\n<meta property=\"article:published_time\" content=\"2013-03-25T13:01:05+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-04-03T17:30:28+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/assets.hongkiat.com\/uploads\/jquery-ui-sortable\/preview-one.jpg\" \/>\n<meta name=\"author\" content=\"Thoriq Firdaus\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@tfirdaus\" \/>\n<meta name=\"twitter:site\" content=\"@hongkiat\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Thoriq Firdaus\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/jquery-ui-sortable\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/jquery-ui-sortable\\\/\"},\"author\":{\"name\":\"Thoriq Firdaus\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/e7948c7a175d211496331e4b6ce55807\"},\"headline\":\"Web Design: Drag and Drop with jQuery UI Sortable\",\"datePublished\":\"2013-03-25T13:01:05+00:00\",\"dateModified\":\"2025-04-03T17:30:28+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/jquery-ui-sortable\\\/\"},\"wordCount\":718,\"commentCount\":37,\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/jquery-ui-sortable\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/jquery-ui-sortable\\\/preview-one.jpg\",\"keywords\":[\"Design Tools\",\"jQuery\"],\"articleSection\":[\"Coding\",\"UI\\\/UX\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/jquery-ui-sortable\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/jquery-ui-sortable\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/jquery-ui-sortable\\\/\",\"name\":\"Web Design: Drag and Drop with jQuery UI Sortable - Hongkiat\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/jquery-ui-sortable\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/jquery-ui-sortable\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/jquery-ui-sortable\\\/preview-one.jpg\",\"datePublished\":\"2013-03-25T13:01:05+00:00\",\"dateModified\":\"2025-04-03T17:30:28+00:00\",\"description\":\"We have covered how to give custom style to jQuery UI, starting from the UI Accordion, UI Slider and the UI Date Picker. Today we will continue our\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/jquery-ui-sortable\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/jquery-ui-sortable\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/jquery-ui-sortable\\\/#primaryimage\",\"url\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/jquery-ui-sortable\\\/preview-one.jpg\",\"contentUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/jquery-ui-sortable\\\/preview-one.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/jquery-ui-sortable\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Web Design: Drag and Drop with jQuery UI Sortable\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\",\"name\":\"Hongkiat\",\"description\":\"Tech and Design Tips\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\",\"name\":\"Hongkiat.com\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wp-content\\\/uploads\\\/hkdc-logo-rect-yoast.jpg\",\"contentUrl\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wp-content\\\/uploads\\\/hkdc-logo-rect-yoast.jpg\",\"width\":1200,\"height\":799,\"caption\":\"Hongkiat.com\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/hongkiatcom\",\"https:\\\/\\\/x.com\\\/hongkiat\",\"https:\\\/\\\/www.pinterest.com\\\/hongkiat\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/e7948c7a175d211496331e4b6ce55807\",\"name\":\"Thoriq Firdaus\",\"description\":\"Thoriq is a writer for Hongkiat.com with a passion for web design and development. He is the author of Responsive Web Design by Examples, where he covered his best approaches in developing responsive websites quickly with a framework.\",\"sameAs\":[\"https:\\\/\\\/thoriq.com\",\"https:\\\/\\\/x.com\\\/tfirdaus\"],\"jobTitle\":\"Web Developer\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/author\\\/thoriq\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Web Design: Drag and Drop with jQuery UI Sortable - Hongkiat","description":"We have covered how to give custom style to jQuery UI, starting from the UI Accordion, UI Slider and the UI Date Picker. Today we will continue our","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.hongkiat.com\/blog\/jquery-ui-sortable\/","og_locale":"en_US","og_type":"article","og_title":"Web Design: Drag and Drop with jQuery UI Sortable","og_description":"We have covered how to give custom style to jQuery UI, starting from the UI Accordion, UI Slider and the UI Date Picker. Today we will continue our","og_url":"https:\/\/www.hongkiat.com\/blog\/jquery-ui-sortable\/","og_site_name":"Hongkiat","article_publisher":"https:\/\/www.facebook.com\/hongkiatcom","article_published_time":"2013-03-25T13:01:05+00:00","article_modified_time":"2025-04-03T17:30:28+00:00","og_image":[{"url":"https:\/\/assets.hongkiat.com\/uploads\/jquery-ui-sortable\/preview-one.jpg","type":"","width":"","height":""}],"author":"Thoriq Firdaus","twitter_card":"summary_large_image","twitter_creator":"@tfirdaus","twitter_site":"@hongkiat","twitter_misc":{"Written by":"Thoriq Firdaus","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.hongkiat.com\/blog\/jquery-ui-sortable\/#article","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/jquery-ui-sortable\/"},"author":{"name":"Thoriq Firdaus","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/e7948c7a175d211496331e4b6ce55807"},"headline":"Web Design: Drag and Drop with jQuery UI Sortable","datePublished":"2013-03-25T13:01:05+00:00","dateModified":"2025-04-03T17:30:28+00:00","mainEntityOfPage":{"@id":"https:\/\/www.hongkiat.com\/blog\/jquery-ui-sortable\/"},"wordCount":718,"commentCount":37,"publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/jquery-ui-sortable\/#primaryimage"},"thumbnailUrl":"https:\/\/assets.hongkiat.com\/uploads\/jquery-ui-sortable\/preview-one.jpg","keywords":["Design Tools","jQuery"],"articleSection":["Coding","UI\/UX"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.hongkiat.com\/blog\/jquery-ui-sortable\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.hongkiat.com\/blog\/jquery-ui-sortable\/","url":"https:\/\/www.hongkiat.com\/blog\/jquery-ui-sortable\/","name":"Web Design: Drag and Drop with jQuery UI Sortable - Hongkiat","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.hongkiat.com\/blog\/jquery-ui-sortable\/#primaryimage"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/jquery-ui-sortable\/#primaryimage"},"thumbnailUrl":"https:\/\/assets.hongkiat.com\/uploads\/jquery-ui-sortable\/preview-one.jpg","datePublished":"2013-03-25T13:01:05+00:00","dateModified":"2025-04-03T17:30:28+00:00","description":"We have covered how to give custom style to jQuery UI, starting from the UI Accordion, UI Slider and the UI Date Picker. Today we will continue our","breadcrumb":{"@id":"https:\/\/www.hongkiat.com\/blog\/jquery-ui-sortable\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.hongkiat.com\/blog\/jquery-ui-sortable\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hongkiat.com\/blog\/jquery-ui-sortable\/#primaryimage","url":"https:\/\/assets.hongkiat.com\/uploads\/jquery-ui-sortable\/preview-one.jpg","contentUrl":"https:\/\/assets.hongkiat.com\/uploads\/jquery-ui-sortable\/preview-one.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/www.hongkiat.com\/blog\/jquery-ui-sortable\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.hongkiat.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Web Design: Drag and Drop with jQuery UI Sortable"}]},{"@type":"WebSite","@id":"https:\/\/www.hongkiat.com\/blog\/#website","url":"https:\/\/www.hongkiat.com\/blog\/","name":"Hongkiat","description":"Tech and Design Tips","publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.hongkiat.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.hongkiat.com\/blog\/#organization","name":"Hongkiat.com","url":"https:\/\/www.hongkiat.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.hongkiat.com\/blog\/wp-content\/uploads\/hkdc-logo-rect-yoast.jpg","contentUrl":"https:\/\/www.hongkiat.com\/blog\/wp-content\/uploads\/hkdc-logo-rect-yoast.jpg","width":1200,"height":799,"caption":"Hongkiat.com"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/hongkiatcom","https:\/\/x.com\/hongkiat","https:\/\/www.pinterest.com\/hongkiat\/"]},{"@type":"Person","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/e7948c7a175d211496331e4b6ce55807","name":"Thoriq Firdaus","description":"Thoriq is a writer for Hongkiat.com with a passion for web design and development. He is the author of Responsive Web Design by Examples, where he covered his best approaches in developing responsive websites quickly with a framework.","sameAs":["https:\/\/thoriq.com","https:\/\/x.com\/tfirdaus"],"jobTitle":"Web Developer","url":"https:\/\/www.hongkiat.com\/blog\/author\/thoriq\/"}]}},"jetpack_featured_media_url":"https:\/\/","jetpack_shortlink":"https:\/\/wp.me\/p4uxU-4m4","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/16744","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/users\/113"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/comments?post=16744"}],"version-history":[{"count":3,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/16744\/revisions"}],"predecessor-version":[{"id":73581,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/16744\/revisions\/73581"}],"wp:attachment":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/media?parent=16744"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/categories?post=16744"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/tags?post=16744"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/topic?post=16744"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}