Toggle navigation
Bootsnipp
Bootstrap
For
CSS Frameworks
Bootstrap
Foundation
Semantic UI
Materialize
Pure
Bulma
References
CSS Reference
Tools
Community
Page Builder
Form Builder
Button Builder
Icon Search
Dan's Tools
Diff / Merge
Color Picker
Keyword Tool
Web Fonts
.htaccess Generator
Favicon Generator
Site Speed Test
Snippets
Featured
Tags
By Bootstrap Version
4.1.1
4.0.0
3.3.0
3.2.0
3.1.0
3.0.3
3.0.1
3.0.0
2.3.2
Register
Login
"Sortable Demo"
Bootstrap 3.2.0 Snippet by
r4zorax
3.2.0
jQuery
table
Preview
HTML
CSS
JS
View Full Screen
Fork
Fork this
8.2K
 
1 Fav
Post to Facebook
Tweet this
<link href="//netdna.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//netdna.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <!------ Include the above in your HEAD tag ----------> <div class="container"> <div class="row"> <h2>Create your snippet's HTML, CSS and Javascript in the editor tabs</h2> <ol class="nested_with_switch vertical"> <li> Item 1 </li> <li> Item 2 </li> <li> Item 3 </li> <li> Item 4 <ol> <li>Item 3.1</li> <li>Item 3.2</li> <li>Item 3.3</li> <li>Item 3.4</li> <li>Item 3.5</li> <li>Item 3.6</li> </ol> </li> <li> Item 5 </li> <li> Item 6 </li> </ol> </div> <script type="application/javascript" src="http://johnny.github.io/jquery-sortable/js/jquery-sortable.js"></script> </div>
body.dragging, body.dragging * { cursor: move !important; } .dragged { position: absolute; opacity: 0.5; z-index: 2000; } ol.example li.placeholder { position: relative; /** More li styles **/ } ol.example li.placeholder:before { position: absolute; /** Define arrowhead **/ } ol.nested_with_switch li, ol.simple_with_animation li, ol.serialization li, ol.default li { cursor: pointer; } ol.vertical li { display: block; margin: 5px; padding: 5px; border: 1px solid #CCC; color: #08C; background: none repeat scroll 0% 0% #EEE; } li { line-height: 18px; } ol { list-style-type: none; } ol { list-style: outside none decimal; } ol.vertical li.placeholder { position: relative; margin: 0; padding: 0; border: none; } /* line 25, /Users/jonasvonandrian/jquery-sortable/source/css/jquery-sortable.css.sass */ ol.vertical li.placeholder:before { position: absolute; content: ""; width: 0; height: 0; margin-top: -5px; left: -5px; top: -4px; border: 5px solid transparent; border-left-color: red; border-right: none; }
$(function () { var oldContainer $("ol.nested_with_switch").sortable({ group: 'nested', afterMove: function (placeholder, container) { if(oldContainer != container){ if(oldContainer) oldContainer.el.removeClass("active") container.el.addClass("active") oldContainer = container } }, onDrop: function (item, container, _super) { container.el.removeClass("active") _super(item) } }) });
Questions / Comments:
Post
Posting Guidelines
Formatting
- Now
×
Close
Donate
BTC: 12JxYMYi6Vt3mx3hcmP3B2oyFiCSF3FhYT
ETH: 0xCD715b2E3549c54A40e6ecAaFeB82138148a6c76