The methods that we can use to control the selectables component from our code are similar to the methods found in other interaction helpers and follow the same pattern of usage. The only unique method exposed by the selectables component is listed below:
Method |
Usage |
---|---|
refresh |
Manually refreshes the positions and sizes of all selectables. Should be used when autoRefresh is set to false. |
Setting the autoRefresh
property to false
can yield performance gains when there are many selectables on the page, especially in IE. However, there will still be times when you will need to refresh the size and positions of the selectables, such as when this component is combined with the draggables component.
Let's take a look at the refresh
method as it leads on perfectly from the last example. Add the following new <button>
element directly after the selectables container:
<button id="refresh">Refresh</button>
We'll also need to link to the draggable source file for...