Skip to content

lt/gt selector behaviour. #276

@chrishilditch

Description

@chrishilditch

The behaviour of the lt selector changed between version 1.7 and 1.8 in the way it handles negative numbers. in 1.7 :lt(-1) selects nothing in 1.8+ :lt(-1) excludes from the end of the array.

I've created a JS fiddle to demonstrate this:
jQuery 1.6 - http://jsfiddle.net/Z5QYz/
jQuery 1.8 - http://jsfiddle.net/Z5QYz/1/
You'll see in the 1.6 version none of the divs are selected, while in the 1.8 version the last one is.

It would be nice to have a 'As of jQuery 1.8 ...' note in the documentation.

EDIT: this also applies to the :gt selector

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions