0
我目前正試圖在點擊時更改子元素的顏色。父元素鏈接到另一個頁面。我希望stopPropogation會起作用,但事實並非如此。以下是我的jQuery代碼:StopPropogation - 無法禁用父錨定標記
$('.child').click(function(){
if($(this).hasClass('pinned')){
$(this).removeClass('pinned')
}
else{
$(this).addClass('pinned')
}
});
// disable parent link when pinning
$('.child').click(function(event){
event.stopPropagation();
});
如果它的事項,錨標籤包圍的祖父母。
我哪裏錯了?
謝謝!我可以在2分鐘內得到答案。 :) – jstacks 2013-02-22 04:44:37