1.2.2 • Published 3 years ago

cmohashnavigation v1.2.2

Weekly downloads
3
License
ISC
Repository
github
Last release
3 years ago

CMO Hash Navigation

Small library to handle scroll navigation on one page websites

Install

npm i cmohashnavigation
import cmoHashNavigation from 'cmohashnavigation';

Setting

  cmoHashNavigation({
    selector: '.nav',
    childSelector: '.hash-link',
    time: 2000,
    easing: 'easeInOutQuad',
    cb: () => console.log("animation finished"),
  });    

  cmoHashNavigation({
    selector: '.options',
    childSelector: '.option-link',
    type: 'select',
    time: 2000,
    easing: 'easeInOutQuad',
    cb: () => console.log("animation finished"),
  });

Options

OptionTypeDefaultDescription
selectorstringnullthe selector, it could be a class, id, or tagname
childSelectorstringnullthe child selector, it could be a class, id, or tagname
typestringnullif is 'select', it will handle as select field
timeintegernullthe animation duration
cbfunctionnullcallback to execute when animation finish
easingstringnullcould be one of these easeInQuad, easeOutQuad, easeInOutQuad, easeInCubic, easeOutCubic, easeInOutCubic, easeInQuart, easeOutQuart, aseInOutQuart, easeInQuint, easeOutQuint, easeInOutQuint.

Demo

For more details see the proyect website.

1.2.2

3 years ago

1.1.2

3 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

6 years ago