输入banner图图片脚本导航/分类

页面返回顶部功能的实现_html/css_WEB-ITnose

这是一个小小的功能,jQuery实现的话很简单,但是对于animate()方法却产生了兴趣,特地记录一下.

首先贴一下返回顶部的功能代码:

1 $(function(){2     $("#toTop").click(function(){3         $("html").animate({"scrollTop": "0px"},100); //IE,FF4         $("body").animate({"scrollTop": "0px"},100); //Webkit5         });6     })

举例如下: