Opened 14 years ago
Closed 12 years ago
#4755 closed bug (worksforme)
Unable to match HTML nodes with $(n1).find("*").is(n2)
Reported by: | sigr0005 | Owned by: | sigr0005 |
---|---|---|---|
Priority: | major | Milestone: | 1.4 |
Component: | selector | Version: | 1.3.2 |
Keywords: | traversing, is, events | Cc: | |
Blocked by: | Blocking: |
Description
Problem:
var e2 = [e1 is a child of e2 but could also be e2];
$(e1).mouseleave(function() {
event.stopPropagation();
isChild = $(e2).find("*").andSelf().is(e1);
if(isChild) alert("This alert is NEVER reached :(");
});
Solution:
replace isChild so that,
isChild = e2.find("*").andSelf().not(e2.find("*").andSelf().not(e1)).is(e1);
It appears that "not()" is the only traversing function working in this case.
Change History (4)
comment:1 Changed 14 years ago by
comment:2 Changed 12 years ago by
Owner: | changed from john to sigr0005 |
---|---|
Status: | new → pending |
Please submit your ticket with a test case reproducing this issue on jsFiddle.
comment:3 Changed 12 years ago by
Status: | pending → new |
---|
comment:4 Changed 12 years ago by
Resolution: | → worksforme |
---|---|
Status: | new → closed |
Note: See
TracTickets for help on using
tickets.
Can you attach a complete test case? Thanks.