单击带有“dc”类的任何一个超链接时,我需要淡出父“内容”div。以下代码是我已经拥有的,但不起作用。
<script>
$('.dc').unbind("click").click(function(){
var dic = this.id;
var strlinkc = "somepage.php?cid=" + dic;
$.post(strlinkc, function(data, textStatus){
$('a.dc#'+dic).closest('.content').fadeOut("slow");
});
});
</script>
<div class="content">
<div id="somediv"><a class="dc" id="23" href="javascript:void(0);">update</a></div>
<div id="anotherdiv">
blah blah blah more text and images
</div>
<div id="yetanother"><a class="dc" id="23" href="javascript:void(0);">update</a></div>
</div>