newSortable(elem,{group: "name",handle: ".my-handle",// Restricts sort start click/touch to the specified elementdraggable: ".item",// Specifies which items inside the element should be sortableghostClass: "sortable-ghost",onAdd: function(evt){varitemEl=evt.item;},onUpdate: function(evt){varitemEl=evt.item;// the current dragged HTMLElement},onRemove: function(evt){varitemEl=evt.item;}});
Sortable.utils
on(el:HTMLElement, event:String, fn:Function) — attach an event handler function
off(el:HTMLElement, event:String, fn:Function) — remove an event handler
css(el:HTMLElement):Object — get the values of all the CSS properties
css(el:HTMLElement, prop:String):Mixed — get the value of style properties
css(el:HTMLElement, prop:String, value:String) — set one CSS properties
css(el:HTMLElement, props:Object) — set more CSS properties
find(ctx:HTMLElement, tagName:String[, iterator:Function]):Array — get elements by tag name
bind(ctx:Mixed, fn:Function):Function — Takes a function and returns a new one that will always have a particular context
closest(el:HTMLElement, selector:String[, ctx:HTMLElement]):HTMLElement|Null — for each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree
toggleClass(el:HTMLElement, name:String, state:Boolean) — add or remove one classes from each element
About
Sortable — is a minimalist JavaScript library for modern browsers and touch devices. No jQuery.
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.
We use cookies and similar technologies ("cookies") to provide and secure our websites, as well as to analyze the usage of our websites, in order to offer you a great user experience. To learn more about our use of cookies see our Privacy Statement.
Select Accept all to consent to this use, Reject all to decline this use, or More info to control your cookie preferences. You can always update your selection by clicking Cookie Preferences at the bottom of the page.
We use cookies and similar technologies ("cookies") to provide and secure our websites, as well as to analyze the usage of our websites, in order to offer you a great user experience. To learn more about our use of cookies see our Privacy Statement.
Essential cookies
We use essential cookies to perform essential website functions, e.g. they're used to log you in.
Learn more
Always active
Analytics cookies
We use analytics cookies to understand how you use our websites so we can make them better, e.g. they're used to gather information about the pages you visit and how many clicks you need to accomplish a task.
Learn more