From a5ee80e72351d5fc8e2c33066276d3b2f066121e Mon Sep 17 00:00:00 2001 From: RubaXa Date: Thu, 11 Dec 2014 11:41:34 +0300 Subject: [PATCH] #167: + ghostClass, scroll, scrollSensitivity, scrollSpeed --- README.md | 48 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b58b94a..aefdd7b 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ var sortable = new Sortable(el, { handle: ".my-handle", // Drag handle selector within list items filter: ".ignore-elements", // Selectors that do not lead to dragging (String or Function) draggable: ".item", // Specifies which items inside the element should be sortable - ghostClass: "sortable-ghost", // Class name for the drop placeholder - jsbin.com/luxero/3 + ghostClass: "sortable-ghost", // Class name for the drop placeholder scroll: true, // or HTMLElement scrollSensitivity: 30, // px, how near the mouse must be to an edge to start scrolling. @@ -198,6 +198,52 @@ Sortable.create(list, { --- +#### `ghostClass` option +Class name for the drop placeholder. + +Demo: http://jsbin.com/boqugumiqi/1/edit?css,js,output + +```css +.ghost { + opacity: 0.4; +} +``` + +```js +Sortable.create(list, { + ghostClass: "ghost" +}); +``` + + +--- + + +#### `scroll` option +If set to `true`, the page (or sortable-area) scrolls when coming to an edge. + +Demo: + - `window`: http://jsbin.com/boqugumiqi/1/edit?html,js,output + - `overflow: hidden`: http://jsbin.com/kohamakiwi/1/edit?html,js,output + + +--- + + +#### `scrollSensitivity` option +Defines how near the mouse must be to an edge to start scrolling. + + +--- + + +#### `scrollSpeed` option +The speed at which the window should scroll once the mouse pointer gets within the `scrollSensitivity` distance. + + +--- + + ### Support AngularJS Include [ng-sortable.js](ng-sortable.js)