Browse Source

#167: + ghostClass, scroll, scrollSensitivity, scrollSpeed

pull/168/head
RubaXa 10 years ago
parent
commit
a5ee80e723
  1. 48
      README.md

48
README.md

@ -48,7 +48,7 @@ var sortable = new Sortable(el, {
handle: ".my-handle", // Drag handle selector within list items handle: ".my-handle", // Drag handle selector within list items
filter: ".ignore-elements", // Selectors that do not lead to dragging (String or Function) filter: ".ignore-elements", // Selectors that do not lead to dragging (String or Function)
draggable: ".item", // Specifies which items inside the element should be sortable 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 scroll: true, // or HTMLElement
scrollSensitivity: 30, // px, how near the mouse must be to an edge to start scrolling. 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.
---
<a name="ng"></a> <a name="ng"></a>
### Support AngularJS ### Support AngularJS
Include [ng-sortable.js](ng-sortable.js) Include [ng-sortable.js](ng-sortable.js)

Loading…
Cancel
Save