Js click sub-level, does not trigger level events, js triggers
First function aa ()
{
$ ("# Zhezhao"). click (function (){
Alert ("11 ");
});
}
Aa ();
$ (". Mains"). click (function (){
$ ('# Zhezhao'). unbind ("click"); // remove the click
SetTimeout (function (){
Aa ();
}, 100)
});
Second
Var isman = 0;
$ ("# Zhezhao"). click (function (){
If (isman = 0)
{
Alert ("11 ");
}
});
$ (". Mains"). click (function (){
Isman = 1; // remove the click
SetTimeout (function (){
Isman = 0;
}, 100)
});
Third (compatibility issues may exist)
$ ("# Zhezhao"). click (function (){
Alert ("11 ");
});
$ (". Mains"). click (function (){
StopPropagation ();
});
Function stopPropagation (e ){
E = e | window. event;
If (e. stopPropagation) {// W3C blocks the Bubble Method
E. stopPropagation ();
} Else {
E. cancelBubble = true; // The IE blocking method
}
}
HTML Tag
<Div id = "zhezhao">
<Div class = "mains"> 11111111111111111111111111111111111111111111 <br/>
11111111111111111111111111111111111111111111 <br/>
11111111111111111111111111111111111111111111 <br/>
</Div>
<Div class = "d"> ******************************** *********
<Br/> ************************************ ****
11111111111111111111111111111111111111111111 <br/>
11111111111111111111111111111111111111111111 <br/>
11111111111111111111111111111111111111111111 <br/>
</Div>
</Div>