There are easy options for connecting serialScroll to "prev" and "next" buttons. I think "first" and "last" buttons are just as handy.
I'm submitting a patch (basically 10 lines of trivial code) to implement this. Patch was made against trunk.
Thanks for the handy plugins!
- patch.txt 1.4KB
Comment #1
Posted on Feb 19, 2010 by Swift ElephantSorry, probably should have been "Enhancement".
Comment #2
Posted on Feb 19, 2010 by Swift GiraffeHi, you can achieve the same doing:
$('#first').click(function(){ $('#pane').trigger('goto', 0); });
And the same for last, it's not really saving you many bytes but adds it for everyone else who isn't using it. I also don't consider that such a common use case.
I appreciate your report though, thanks :)
Comment #3
Posted on Feb 20, 2010 by Swift ElephantTrue, it's straight-forward to do that for the "#first" button.
However, having to specify the pane/target twice (in addition to the call to serialScroll) and having to declare how many items there are for the "#last" function is redundant, considering serialScroll already "knows about" and has easy access to both.
SYou could be more terse, at the expense of readability: {{{ $(settings.last||[]).bind(event, function(e){jump(e,items.length)}); //jump to last item }}}
Comment #4
Posted on Feb 20, 2010 by Swift ElephantOr maybe the "move" function could handle special values like 'last'?
Comment #5
Posted on Feb 20, 2010 by Swift GiraffeYou can also know the amount of items right away from the outside with a simple selector:
$('#pane li').length
I insist that going to first and last is not that common and doesn't add new possibilities to the plugin, just saves a few bytes for a minority.
Status: WontFix
Labels:
Type-Enhancement
Priority-Medium