-
LangagesJS, SCSS, HTML
-
DépendancesAucune
-
Normes WCAGOui
-
AuteursIan Reid Langevin
Demo
Faites défilez cette page pour voir la navbar devenir sticky. Un data-attribute
est ajouté sur le body
, vous permettant de styliser la navbar ou autres éléments selon le scroll. Vous pouvez ainsi créer une navbar qui shrink, etc.
Documentation
Importez la fonction dans votre projet
Adaptez le path selon la structure de votre projet
import { NavbarSticky } from "./functions/navbar-sticky"
Créez et initialisez une instance - exemple
// create an instance with your options
new NavbarSticky(".navbar-sticky", {
// add your options here
}).init()