@bornfight/b-scroll-lock

    1.0.7 • Public • Published
    Bornfight

    b-scroll-lock [all b- libs]

    Bornfight frontend micro lib for locking and unlocking the scroll

    GitHub package.json version GitHub package.json dynamic GitHub issues GitHub

    📦 Getting Started

    • install b-scroll-lock trough npm or pull ti from git
    npm i @bornfight/b-scroll-lock
    
    • include b-lib to your JS after running npm install

    🔨️ Usage

    JS
    import ScrollLock from "@bornfight/b-scroll-lock";
    Usage tips
    • class contains two methods, one for lock scroll and one for unlock
    • every method has one property that could be passed

    💎 Customization

    const scrollLock = new ScrollLock();
    
    // value 100 represent on witch scroll value will "is-fixed-scrolled" class be added to body
    // offset value (100) is optional and default is 100
    scrollLock.lockScroll(100);
    
    // value 100 represent on witch scroll value will document be after scroll is unlocked
    // offset value (100) is optiona and default is scroll value before locking the scroll
    scrollLock.unlockScroll(100);

    🚀 Useful to know

    1. if used with page transition - don't forget to unlock scroll
    2. will not work for scroll inside modal/popup

    📦 Contribute

    Gulp based system

    npm run dev - dev environent with browsersync

    License

    MIT © Bornfight

    Install

    npm i @bornfight/b-scroll-lock

    DownloadsWeekly Downloads

    12

    Version

    1.0.7

    License

    MIT

    Unpacked Size

    9.9 kB

    Total Files

    9

    Last publish

    Collaborators

    • antonio.preucil
    • ilesar
    • maroje
    • degordian-dev
    • mario.loncarek
    • tjezidzic
    • shockwavee
    • jurajuki
    • ddrempe