好的,很快。
我已经通过$ .ajax()加载了这个DIV,并且将以下jquery live()附加到$('div').live('click', function(event) {});
,但是在这个DIV中有一个jquery fancybox库的锚点。
html:
<div>
<a class="foo" href="some-image.png"><img src="some-thumb.png"></a>
<a class="foo" href="some-image2.png"><img src="some-thumb2.png"></a>
<a class="foo" href="some-image2.png"><img src="some-thumb2.png"></a>
</div>
jquery的:
$('div').live('click', function(event) {
alert();
});
$('.foo').fancybox();
我想在点击图库链接后阻止div动作执行... 我对此有所了解。 希望你能帮忙。
答案 0 :(得分:0)
您需要使用stopPropagation,请查看我的示例http://jsfiddle.net/abimaelmartell/ZS8Yw/
$('a').on("click",function(event){
event.stopPropagation();
alert("link");
})