Created
December 12, 2011 16:29
-
-
Save sczizzo/1468098 to your computer and use it in GitHub Desktop.
Turn a site with jQuery into a strobe light
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
function swap() { | |
if ($(window).data('on') === undefined) { | |
$('body').remove(); | |
$('html').css('background', 'white'); | |
$(window).data('on', false); | |
} | |
if ($(window).data('on')) { | |
$('html').css('background', 'black'); | |
$(window).data('on', false); | |
} else { | |
$('html').css('background', 'white'); | |
$(window).data('on', true); | |
} | |
setTimeout('swap()', 25); | |
} | |
swap(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment