Skip to content

Instantly share code, notes, and snippets.

@bytespider
Forked from stdclass/LICENSE.txt
Created August 30, 2011 13:11
Show Gist options
  • Save bytespider/1180838 to your computer and use it in GitHub Desktop.
Save bytespider/1180838 to your computer and use it in GitHub Desktop.
The Comeback of the BLINK-Tag
var blinkify = function(
el, // DOM-Element
rate // Speed (Default: 500 ms)
){
setInterval(function(){ // Interval
el.style.opacity ^= 1 // change the visibility
}, rate || 500 );
}
function(a,b){setInterval(function(){b=a.style.opacity^=1},b||500)}
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.
{
"name": "blinkify",
"description": "The Comeback of the Blink-Tag",
"keywords": [
"blink",
"blinktag",
"retro"
]
}
<!doctype html>
<html>
<head>
</head>
<body>
<b id="test">BLINKY</b><br />
<b id="test2">BLINKY - fast</b>
<script>
var blinkify = function( el, rate ){
setInterval(function(){
el.style.opacity ^= 1
}, rate || 500 );
}
blinkify( document.getElementById( "test" ) );
blinkify( document.getElementById( "test2" ), 100 );
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment