GithubHelp home page GithubHelp logo

hhy5277 / clever-scrollbar Goto Github PK

View Code? Open in Web Editor NEW

This project forked from believer-ufa/clever-scrollbar

0.0 2.0 0.0 26 KB

UI Addition to browser scrollbar

Shell 0.79% HTML 80.24% JavaScript 16.80% CSS 2.18%

clever-scrollbar's Introduction

Clever Scrollbar

Its simple sidebar which helps to navigate on web page.

It is not a replacement of Default Browser Scrollbar. It's an addition to it.

Check example on believer-ufa.github.io/clever-scrollbar/

Setup

  1. Add library script
<script src="dist/clever-scrollbar.js"></script>
  1. Add additional attributes to main sections on you page
<body>

    <div class='head' data-content-block="Header">...</div>

    <div class='article-content' data-content-block="Article text">...</div>

    <div class='comments' data-content-block="Users's comments">...</div>

</body>
  1. And execute CleverScrollbar.load() method after loading all content!
window.addEventListener("load", function() {
    CleverScrollbar.load()
})

This is all of you need.

Additional classes

If you need to set some additional classes to one of blocks of sidebar, you can do this with additional attribute:

<div
    class='article-content'
    data-content-block="Article text"
    data-content-block-classes='main-content-block other-class'
>...</div>

Ajax and SPA applications

If you webpage content changed withoud full reload, you can use method CleverScrollbar.reload() to update you sidebar.

Stopping

Run CleverScrollbar.stop() to disable library. You can load it again later.

clever-scrollbar's People

Contributors

believer-ufa avatar

Watchers

 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.