Bug Tracker

Opened 10 years ago

Closed 9 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 10 years ago by dmethvin

Can you attach a complete test case? Thanks.

comment:2 Changed 9 years ago by addyosmani

Owner: changed from john to sigr0005
Status: newpending

Please submit your ticket with a test case reproducing this issue on jsFiddle.

comment:3 Changed 9 years ago by sigr0005

Status: pendingnew

Appears to be working just fine now ;-)

http://jsfiddle.net/m7n9q/1/

[close]

comment:4 Changed 9 years ago by snover

Resolution: worksforme
Status: newclosed
Note: See TracTickets for help on using tickets.