ITeye博客

返回顶部效果(转)

JoeZe · 2013-06-09 01:47 · JQuery · Web前端 · HTML · jQuery · Markdown


$(function(){
    $(window).scroll(function () {
        if ($(this).scrollTop() > 500) {
            $('#toTop').fadeIn();
        } else {
            $('#toTop').fadeOut();
        }
    });
    $("#toTop").click(function(){
        $("html,body").animate({scrollTop:0},"slow");
        return false;
    });    
});

转自http://aijuans.iteye.com/blog/1884591

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。