1

如果我有一个clicked类的侦听器和另一个click-option-1click-option-2click-option-3 的侦听器,我如何在我的clicked事件侦听器中判断click-option-3是否被点击?

<div class="clicked">
   <div class="click-option-1">1</div>
   <div class="click-option-2">2</div>
   <div class="click-option-3">3</div>
</div>

$( '.clicked' ).on( "touchstart mousedown", function(event) {

if .click-option-3 was not clicked do something.

});
4

1 回答 1

4
$('.clicked').on('touchstart mousedown', function(e){
    if(!$(e.target).hasClass('click-option-3')){
        //Do This.
    }
});
于 2012-08-09T00:26:00.407 回答