This repository has been archived by the owner on Jun 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
How does it work
László Károlyi edited this page Apr 2, 2014
·
8 revisions
Since this plugin is an extension of the original ui-selectable, please look for the documentation on how it works: http://api.jqueryui.com/selectable/
The slight difference is, the selector lasso helper can't be pulled outside of the selectable-scrollable container, showing where the parent container should start scrolling. Now, it also watches for scrollbars.
- Import jQuery/jQuery-ui (with the original ui-selectable) in the
<head>
tag first, then the plugin. - If you want to use the modified selector lasso (where sides disappearing when scrolling out of viewport), import the
jquery-ui-ext.css
after jQuery ui's own css file.
- Initialize the selectable on the parent container of selectables (the scrollable element). Options are the same to the original ui-selectable, extended with these (copied from source):
scrollSnapX: 5, // When the selection is that pixels near to the top/bottom edges, start to scroll
scrollSnapY: 5, // When the selection is that pixels near to the side edges, start to scroll
scrollAmount: 25, // In pixels
scrollIntervalTime: 100 // In milliseconds
-
Profit!
-
It is important to mention that all the events the original selectable emits, are now becoming to
selectablescrollstop
for example, that means,selectable
getsselectablescroll
in all the expected events.