Created
March 22, 2013 01:17
-
-
Save j0lvera/5218232 to your computer and use it in GitHub Desktop.
Color Animation - jQuery
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script> | |
<script src="https://raw.github.com/jquery/jquery-color/master/jquery.color.js"></script> | |
<meta charset=utf-8 /> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<div class="test">test</div> | |
<script> | |
var test = $('.test'), | |
a = true; | |
setInterval(function() { | |
if ( a === true ) { | |
test.animate({ backgroundColor: "red" }, "fast"); | |
a = false; | |
} else { | |
test.animate({ backgroundColor: "yellow" }, "fast"); | |
a = true; | |
} | |
}, 1500); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment