Bug Tracker

Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#189 closed bug (invalid)

prev() does not work as expected

Reported by: ieure Owned by:
Priority: major Milestone: 1.0
Component: core Version: 1.0
Keywords: Cc:
Blocked by: Blocking:


prev() is supposed to return the unique preceding siblings of the selected set, but it doesn't work correctly. It seems to check the tag and/or class name instead of comparing the actual nodes.



If you now do:

$('div span').hover(function()

The returned set only contains the span node immediately preceding the hovered element, not every span node preceding it.

This happens in 1.0.1, by the way, though that's not an option in this form.

Change History (2)

comment:1 Changed 16 years ago by joern

The discription of prev() is somewhat irritating: It states that it returns a set of elements. But in the next sentence, it says: It only returns the immediately previous sibling, not all previous siblings. I'm not sure about the intentions behind this, and if there is an easy way to do "prevs()" to return all previous siblings, not only the immediate.

comment:2 Changed 16 years ago by john

Resolution: invalid
Status: newclosed

This is correct, .prev() only retreives the single element preceding the current element - there is currently no way to select all preceding elements, but it's something that's going to be added very soon.

Note: See TracTickets for help on using tickets.