Git Product home page Git Product logo

demos's Introduction

demos

Demos for practice

1.Reading Progress Bar

  • 概述:进度条记录阅读进度。

  • 主要步骤:

    • 添加需要的DOM;
    • 给进度块设置fix->unfix的动态变化条件(文档与进度块的滚动位置关系);
    • 根据滚动条和元素位置(文档与标题的滚动位置关系),给进度条设置相应的类;
    • 根据滚动进度条滚动的长度(在进度区间的文档滚动百分比);
    • 点击进度块时的跳转。
  • 注意:

    • 当某元素在某一位置固定时,它的offset(-top就和文档的scrollTop相等;
    • 注意每一次条件改变时的跳动,以及状态变化的条件。可设置一定的“垫块(-shim)”过度;
    • 考虑开始、中间、结束这三个过程的状态变化。

demos's People

Contributors

yawenina avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.