Modify ↓
Ticket #7894 (closed bug: wontfix)
Selector option:gt(-1) doesn't work
| Reported by: | g_gus | Owned by: | |
|---|---|---|---|
| Priority: | undecided | Milestone: | 1.6 |
| Component: | unfiled | Version: | 1.4.4 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
very similar to #5550 but with a use case that's imho not invalid:
In writing a pagination function it would be useful to have the :gt behave consistently, accepting -1 as a possible value.
Here's a simple use case: http://jsfiddle.net/GMJZ5/1/
Thanks.
Change History
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
Note: See
TracTickets for help on using
tickets.

Better yet, you could get rid of the custom selectors completely. http://jsfiddle.net/danheberden/yxQgd/
Thanks for taking the time to write out a bug report / feature request. In the case of :gt, gt(-1) seems odd to me. gt(-1) is simply less than something else. That is, :gt(-1):lt(5) is simply lt(5). Plus, there is no -1 index to be greater than. I know if makes sense that index 0 is greater than anything, but -1 doesn't exist.
Custom selectors aren't great in any respect, as the above example I pasted doesn't even have to use sizzle. Faster and cleaner; the gains are two fold.