1.点击返回顶部(#top为返回顶部按钮)
$('#top').click(function () {
$('html , body').animate({scrollTop:$('html , body').offset().top},500);
});
2.点击返回同页面中某一位置(#con为页面中某一位置,滑动时间500)
$('#con').click(function () {
$('html , body').animate({scrollTop:$('.con').offset().top},500);
});
3.使用除a标签外的其他标签跳转页面
function accumulation_fund(){
window.location.href="accumulation_fund.html";
}
对应html
<li onclick=javascript:accumulation_fund()>
<img src="../images/port1.jpg" alt="" style="width:100%;height:90%;margin-top:8%;">
<p>*****</p>
</li>