我想用jQuery从href向下滚动到特定的div,我的代码是:
<ul class="menu2">
<li><a href="#whoweare">About</a></li>
<li><a href="#services">Services</a></li>
</ul>
<div id="whoweare"></div>
<div id=services "></div>
谢谢
答案 0 :(得分:1)
$(".YourClass").click(function () {
$('html,body').animate({ scrollTop: $(this.hash).offset().top }, 500);
});