1.0.1 • Published 7 years ago

temporary-class v1.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

Temporary Class

Add a class to an element for a specified amount of time.

Credit: This plugin is an expansion from this forum post by Dan S

Parameters

ParamTypeDescription
1stringThe name of the class to be added
2numberHow long the class should exist on the element
3numberDelay for then the class should be added innitially

Usage

Add a class for 2 seconds, then remove it.

$("#myElement").addTemporaryClass("myClass", 2);

After 3 seconds, add a class for 2 seconds, then remove it.

$("#myElement").addTemporaryClass("myClass", 2, 3);