Skip to content

Latest commit

 

History

History
25 lines (18 loc) · 744 Bytes

README.md

File metadata and controls

25 lines (18 loc) · 744 Bytes

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

Param Type Description
1 string The name of the class to be added
2 number How long the class should exist on the element
3 number Delay 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);