【发布时间】:2012-05-09 12:52:44
【问题描述】:
我想在单击子链接时停止父事件触发。这是我的代码:
$('.list_row_inputtype').on('click',function(event) {
$(this).find('a.link_to_fire').click();
event.stopPropagation();
return false;
});
<div class="list_row_input_type unread">
<a href="#" onclick="toogleRead(); return false;" class="toogleRead"></a>
<a href="{corePath}/mails" class="link_to_fire">{emailLink}</a>
<div class="description"></div>
</div>
当我点击.toogleRead 时,它会触发该功能,但也会切换到{corePath}/mails 页面。我想阻止它改变页面。
【问题讨论】:
标签: jquery jquery-events stoppropagation