`

使用Jquery 实现scroll to top 效果

 
阅读更多
$(document).ready(function(){
$(window).scroll(function () {
        if($(window).scrollTop()=="0") {
            $('.back_top').fadeOut(300)
        }else {
            $('.back_top').fadeIn(300)
        }
    });
$('.back_top').click(function(){$("html,body").animate({scrollTop:0},300);return false});
});
分享到:
评论

相关推荐

    Scroll to Top Button using JQuery.zip

    JavaScript

    scrollToTop - a jQuery plugin

    One click to scroll back to the top of the webpage. http://geniuscarrier.com/scrolltotop-a-jquery-plugin/

    scrollToTop - jQuery Plugin

    One click to scroll back to the top of the webpage.

    jQuery开发技巧

    place this where you want to scroll to <a name "top">< a> the link <a href "#top">go to top< a> 10 获取鼠标位置 $ mousemove function e { display the x...

    jquery横向图片滚动在线示例

    一个jquery横向图片滚动在线示例,用了自己的一个JS-lrscroll.js [removed] $(function() { $("#botton-scroll").jCarouselLite({ btnNext: ".next", btnPrev: ".prev" }); }); $(function () { $('#top-...

    material-scrolltop:轻巧,受Material Design启发的插件,可在html页面顶部滚动(使用jQuery或TypeScript)

    具有波纹效果 流畅动画 有一些有用的... jQuery + CSS,(TypeScript + SCSS) 演示(示例) 观看此内容: : 安装 通过纱线或npm yarn add material-scrolltop 手动安装(下载) 如果需要最新的稳定版本,请从...

    DockIt:插件jQuery和Zepto来添加内容

    DockIt Zepto和jQuery插件可使用高级选项停靠/粘贴任何内容 演示: ...dockToTopFrom Default : false Type : number Dock to top when this value (in px) is reached by scroll dockToBottomFrom De

    Work-Day-Scheduler:日历应用程序,该应用程序允许用户通过修改启动程序代码来保存一天中每个小时的事件。 该应用程序将在浏览器中运行,并具有由jQuery支持的动态更新HTML和CSS

    工作日程 日历应用程序,允许用户通过修改启动程序代码来保存一天中每个小时的事件。 该应用程序将在浏览器中运行,并具有由...THEN the current day is displayed at the top of the calendar WHEN I scroll down THE

    workday-scheduler:一种用颜色编码的工作日计划程序应用程序,用于保存当天的任务

    它是使用Javascriot和JQuery构建的。 用户故事 AS AN employee with a busy schedule I WANT to add important events to a daily planner SO THAT I can manage my time effectively 验收标准 GIVEN I am using a ...

    Work_Day_Scheduler

    它使用引导CSS框架,moment.js库,jquery / javascript和html。 它能够将条目存储到本地存储中,并帮助您跟踪日常计划。 用户的故事 AS AN employee with a busy schedule I WANT to add important events to a ...

    Day-Planner:https

    日程安排 描述 一个简单的日历应用程序,允许用户保存一天中每个小时的事件。 该应用程序在浏览器中运行,并具有由jQuery支持的动态更新HTML和CSS。 库用于处理日期和时间。 Moment.js ...WHEN I scroll

    KU-CBC-Homework-5-Work-Day-Scheduler

    用户的故事AS AN employee with a busy scheduleI WANT to add important events to a daily plannerSO THAT I can manage my time effectively验收标准GIVEN I am using a daily planner to create a scheduleWHEN ...

    Work-Day-Scheduler

    我的任务 我的任务是创建一个简单的日历应用程序,该应用程序允许用户通过修改启动程序代码来保存一天中每个小时的事件。...THEN the current day is displayed at the top of the calendar WHEN I scroll down THEN I

    Sortable前端框架

    * No jQuery (but there is [support](#jq)) ### Articles * [Sortable v1.0 — New capabilities](https://github.com/RubaXa/Sortable/wiki/Sortable-v1.0-—-New-capabilities/) (December 22, 2014...

    work-day-scheduler

    THEN the current day is displayed at the top of the calendar WHEN I scroll down THEN I am presented with timeblocks for standard business hours WHEN I view the timeblocks for that day THEN each ...

    工作日时间表

    **标准GIVEN I am using a daily planner to create a scheduleWHEN I open the plannerTHEN the current day is displayed at the top of the calendarWHEN I scroll downTHEN I am presented with time blocks ...

    dayPlanner:允许用户将重要事件添加到每日计划中

    以便我可以有效地管理我的时间故事 GIVEN I am using a daily planner to create a scheduleWHEN I open the plannerTHEN the current day is displayed at the top of the calendarWHEN I scroll downTHEN I am ...

    daily-planner

    GIVEN I am using a daily planner to create a schedule WHEN I open the planner THEN the current day is displayed at the top of the calendar WHEN I scroll down THEN I am presented with timeblocks for ...

    time-block-planner

    GIVEN I am using a daily planner to create a schedule WHEN I open the planner THEN the current day is displayed at the top of the calendar WHEN I scroll down THEN I am presented with timeblocks for ...

    Daily-Planner

    GIVEN they are using a daily planner to create a schedule WHEN they open the planner THEN the current day is displayed at the top of the calendar WHEN they scroll down THEN they are presented with ...

Global site tag (gtag.js) - Google Analytics