Just a little update to my checkbox range selection jQuery plugin to allow chaining. I'd forgotten to return 'this' at the end of the function. Here's the full source, including the mod:
(function($) {
$.fn.enableCheckboxRangeSelection = function() {
var lastCheckbox = null;
var $spec = this;
$spec.bind("click", function(e) {
if (lastCheckbox != null && e.shiftKey) {
$spec.slice(
Math.min($spec.index(lastCheckbox), $spec.index(e.target)),
Math.max($spec.index(lastCheckbox), $spec.index(e.target)) + 1
).attr({checked: e.target.checked ? "checked" : ""});
}
lastCheckbox = e.target;
});
return $spec;
};
})(jQuery);
You can check the project page as well, for full history and updates.


I'm looking for just this block of code for use in Habari–short and sweet. Any chance you'll let me? :)
Michael,
Of course, have at it.
Awesome, thank you.
Cheers mate. Very useful. Would never have thought to use splice.