Browse Source

Update readme for new parameters to scrollCustomFn

pull/1266/head
Noel Heesen 7 years ago
parent
commit
423e055acd
  1. 10
      README.md

10
README.md

@ -98,10 +98,10 @@ var sortable = new Sortable(el, {
fallbackClass: "sortable-fallback", // Class name for the cloned DOM Element when using forceFallback fallbackClass: "sortable-fallback", // Class name for the cloned DOM Element when using forceFallback
fallbackOnBody: false, // Appends the cloned DOM Element into the Document's Body fallbackOnBody: false, // Appends the cloned DOM Element into the Document's Body
fallbackTolerance: 0, // Specify in pixels how far the mouse should move before it's considered as a drag. fallbackTolerance: 0, // Specify in pixels how far the mouse should move before it's considered as a drag.
scroll: true, // or HTMLElement scroll: true, // or HTMLElement
scrollFn: function(offsetX, offsetY, originalEvent) { ... }, // if you have custom scrollbar scrollFn may be used for autoscrolling scrollFn: function(offsetX, offsetY, originalEvent, touchEvt, hoverTargetEl) { ... }, // if you have custom scrollbar scrollFn may be used for autoscrolling
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.
scrollSpeed: 10, // px scrollSpeed: 10, // px
@ -163,7 +163,7 @@ var sortable = new Sortable(el, {
originalEvent.clientY; // mouse position originalEvent.clientY; // mouse position
// return false; — for cancel // return false; — for cancel
}, },
// Called when creating a clone of element // Called when creating a clone of element
onClone: function (/**Event*/evt) { onClone: function (/**Event*/evt) {
var origEl = evt.item; var origEl = evt.item;
@ -347,7 +347,7 @@ Demo: http://jsbin.com/yacuqib/edit?html,css,js,output
Emulates the native drag threshold. Specify in pixels how far the mouse should move before it's considered as a drag. Emulates the native drag threshold. Specify in pixels how far the mouse should move before it's considered as a drag.
Useful if the items are also clickable like in a list of links. Useful if the items are also clickable like in a list of links.
When the user clicks inside a sortable element, it's not uncommon for your hand to move a little between the time you press and the time you release. When the user clicks inside a sortable element, it's not uncommon for your hand to move a little between the time you press and the time you release.
Dragging only starts if you move the pointer past a certain tolerance, so that you don't accidentally start dragging every time you click. Dragging only starts if you move the pointer past a certain tolerance, so that you don't accidentally start dragging every time you click.
3 to 5 are probably good values. 3 to 5 are probably good values.

Loading…
Cancel
Save