首先贴一下返回顶部的功能代码:
1 $(function(){2 $("#toTop").click(function(){3 $("html").animate({"scrollTop": "0px"},100); //IE,FF4 $("body").animate({"scrollTop": "0px"},100); //Webkit5 });6 })
举例如下:
script> script>