1.0.8 • Published 4 years ago

@atyoursite/classnames v1.0.8

Weekly downloads
1
License
ISC
Repository
-
Last release
4 years ago

ClassNames

ElClassName Class

Description

This class is for manipulating classNames

Installation

Open a terminal window inside the root of your project to install the node package.

npm install --save-dev @atyoursite/classnames

Dependency

To be able to use this class, you will have to import it as a dependency

import { ElClassName } from '@atyoursite/classnames';

Instantiate the class

Class parameters

  • el - jQuery element
  • className - Default 'is-hidden'

example

const topNavHide = new elClassName($('#elFixedNavbar'), 'your-class');

Method fromPosition() parameters

  • offset - scrollTop offset to toggle the className

Usage

// Hide and show navigation based on scrolling position and behavior
const topNavHide = new elClassName($('#elFixedNavbar'));
window.addEventListener("scroll", throttle(topNavHide.fromPosition(800), 300));
1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago