This plugin allows to select items from a container by dragging a rubberband selection.
accept | string | mandatory | the class name for items inside container |
selectedclass | string | optional | when an acceptable item is selected gets this class |
helperclass | string | optional | the class applied to the selection rectacle |
opacity | float ( < 1) | optional | opacity for the item while in drag |
onselect | function | optional | callback that get as argument the selection serialize |
Code sample:
$('#selectable1').Selectable(
{
accept : 'selectableitem',
opacity : 0.2,
selectedclass : 'selecteditem',
helperclass : 'selecthelper',
onselect : function(serial)
{
alert(serial.hash);
}
}
);
Selectserialize
This function returns the hash and an object (can be used as arguments for $.post) with the selection. The hash is based on the 'id' attributes of container and items.