Created
April 3, 2012 18:22
-
-
Save whylom/2294410 to your computer and use it in GitHub Desktop.
How to start and stop a light from blinking.
This file contains 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
var blinking; | |
function startBlinking() { | |
blinking = setInterval(function() { | |
$('.light').toggleClass('on'); | |
}, 750); | |
} | |
function stopBlinking() { | |
clearInterval(blinking); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment