Opened 14 years ago
Closed 14 years ago
#3657 closed feature (invalid)
New feature: selfOrParents traversal function
Reported by: | jollytoad | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 1.3 |
Component: | core | Version: | 1.2.6 |
Keywords: | Cc: | jollytoad | |
Blocked by: | Blocking: |
Description
I find it handy to be able to traverse using parents, but include the current context in the search, like the XPath ancestors-or-self axis.
It's very handy for this kind of thing:
if (!$(...).selfOrParents(':hidden').length) {
do something because we are visible
}
rather than having to do:
var tmp = $(...);
tmp.parents(':hidden').length)) { ... } |
I've attached a patch, it's very small :)
Attachments (1)
Change History (2)
Changed 14 years ago by
Attachment: | selfOrParents.patch added |
---|
comment:1 Changed 14 years ago by
Cc: | jollytoad added |
---|---|
Resolution: | → invalid |
Status: | new → closed |
Note: See
TracTickets for help on using
tickets.
If I'm not wrong, that can be achieved with:
That seems to me like pretty much the same amount of code. So.. I think this is not really useful, generally speaking.