What’s the easiest way to make text toggle between two colors/classes continuously with jquery?
What’s the easiest way to make text toggle between two colors/classes continuously with jquery?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A simple example:
CSS
jQuery (at
DOMreadyevent)Example fiddle : http://jsfiddle.net/gLEuP/
Otherwise, you could avoid at all JS on modern browser and use only CSS3 animation, e.g.
Example codepen (with vendor prefixes): http://codepen.io/anon/pen/NPJBbe
Note, avoid to set a too small delay, it could hurt people affected by photosensitive epilepsy (and annoying for everyone else)