我有一个带有 3 个内部 href 的 div。我需要使 div 可点击并让它继承内部 href 之一。没问题...但是这会导致 JS 覆盖 div 内的其他链接,这些链接我没有为父 div 继承。这是我的代码:
<script>
$(document).ready(function(){
$("#Products div.product").click(function(){
window.location=$(this).find("a.product_link").attr("href"); return false;
}
);
</script>
<div class="product">
<div class="icon">
<a href="/training/programme/fire-awareness-in-the-workplace" class="product_link" title="Fire Awareness in the Workplace"><img src="/assets/public/btn_FA_icon.gif" alt="image" width="70" height="70" /></a>
</div>
<div class="summary">
<h2>Fire Awareness in the Workplace</h2>
<p>All staff must complete fire awareness training - this excellent programme is all you need to train your employees at minimum cost and disruption.</p>
</div>
<div class="btns">
<a href="/purchase/single/FA" class="single" title="Buy Now...">Buy Now...</a>
<a href="/training/preview/FA" class="single" title="Free Trial...">Free Trial...</a>
</div>
</div>
所以......有什么想法吗?:)