Skip to content

marknotton/temporary-class

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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);

About

Add a class for a specified amount of time

Resources

Stars

Watchers

Forks

Packages

No packages published