All Projects → believer-ufa → clever-scrollbar

believer-ufa / clever-scrollbar

Licence: other
UI Addition to browser scrollbar

Programming Languages

HTML
75241 projects
javascript
184084 projects - #8 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to clever-scrollbar

Overlayscrollbars
A javascript scrollbar plugin which hides native scrollbars, provides custom styleable overlay scrollbars and keeps the native functionality and feeling.
Stars: ✭ 2,054 (+7507.41%)
Mutual labels:  scrollbar-plugin
Perfect Scrollbar
Minimalistic but perfect custom scrollbar plugin. Get more free components with Material Design for Bootstrap UI Kit (link below)
Stars: ✭ 8,593 (+31725.93%)
Mutual labels:  scrollbar-plugin

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

Add library script

<script src="dist/clever-scrollbar.js"></script>

Or install from NPM as module:

npm i clever-scrollbar

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>

And execute CleverScrollbar.load() method after loading all content!

window.addEventListener("load", function() {
    CleverScrollbar.load()
})

This is all of you need.

Options

Load default stylesheets?

If you want to prevent loading default styles of library, you can use this approach:

CleverScrollbar.load({
  loadStyles : false
})

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].