Skip to content

ez90/scroll-back

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Scrollback

Lightweight JS ( ES6 syntax ) to handle when user scroll back. ( strongly inspired by http://wicky.nillia.ms/headroom.js/ )

How to

// Select dom element you want to manage 
var header = document.querySelector("header")

// Init and set scrollback
var headerScrollBack = new scrollback(header, {
    tolerance: {
        up: 0,
        down: 0
    },
    offset: 80,
    scroller: window,
    disable: false,
    classes: {
        initial: 'header',
        pinned: 'header-pinned',
        unpinned: 'header-unpinned',
        scrolled: 'header-nottop'
    }
})

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published