Skip to content

Instantly share code, notes, and snippets.

@anoopsankar
Created September 5, 2012 06:19
Show Gist options
  • Save anoopsankar/3631520 to your computer and use it in GitHub Desktop.
Save anoopsankar/3631520 to your computer and use it in GitHub Desktop.
CSS Flicker
#text-block .flickr {
color: transparent;
text-shadow: white 0 0 1px;
-webkit-transition: text-shadow 0.2s ease-in-out;
-moz-transition: text-shadow 0.2s ease-in-out;
transition: text-shadow 0.2s ease-in-out;
}
<div id="text-block">
I am a <span class="flickr">tubelight</span>
</div>
$(document).ready(function() {
setInterval(function() {
var val = 1;
if (Math.random() > 0.5) {
val = Math.floor((Math.random()*10)+1);
}
$(".flickr").css("text-shadow", "white 0 0 " + val + "px");
}, 200);
});
@MarkovRetro
Copy link

Thanks for that! 👍

@ajaymenon0
Copy link

Thank you! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment