标签:
$(‘.back_top‘).bind(‘click‘, function() {
$("html, body").animate({ scrollTop: 0 }, 200);
});
$(‘.back_top‘).bind({click:function() {
$("html, body").animate({ scrollTop: 0 }, 200)}
});
html返回顶部
1.<body style=‘height:3000px;‘><div style="position:fixed;bottom:100px;"><a href="#" target="_self">UP</a></div></body>
2.<a style="position:fixed;bottom:10px; left:10px;" onclick="javascript:scroll(0,0)">TOP</a>
<a style="position:fixed;bottom:10px; left:10px;" onclick="window.scroll(0,0)">TOP</a>
bind()多个事件EG:
$(document).ready(function(){
$("button").on({
click:function(){$("p").slideToggle();},
mouseover:function(){$("body").css("background-color","red");},
mouseout:function(){$("body").css("background-color","#FFFFFF");}
});
});
标签:
原文地址:http://www.cnblogs.com/mrt-yyy/p/4449928.html