0
我在頁面上使用scrollTo並希望將該功能應用於所有鏈接。不應該這個代碼工作?我在這裏忘了什麼?scrollTo所有鏈接
感謝
<script type="text/javascript">
$(document).ready(function(){
var target = $(this).attr('href');
$('.scrollTo').scrollTo(target);
});
</script>
<li><a class="scrollTo" href="#ref1">Recommendation for Developing and Disseminating Hazard and Exposure Data: The Integrated Tiered Testing and Assessment Approach</a></li>
<div id="ref1">
<h3>REFERENCE 1. Recommendation for Developing and Disseminating Hazard and Exposure Data: The Integrated Tiered Testing and Assessment Approach</h3>
</div>
這不適合我嗎?... – EZDC 2013-02-19 14:09:59