Skip to content

Instantly share code, notes, and snippets.

@reelsense
Created July 19, 2016 02:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save reelsense/a0cba2f24e66a4d10f28bc3f3e28f728 to your computer and use it in GitHub Desktop.
Save reelsense/a0cba2f24e66a4d10f28bc3f3e28f728 to your computer and use it in GitHub Desktop.
Remove burn in with magic
var $burnGuard = $('<div>').attr('id','burnGuard').css({
'background-color':'#FF00FF',
'width':'1px',
'height':$(document).height()+'px',
'position':'absolute',
'top':'0px',
'left':'0px',
'display':'none'
}).appendTo('body');
var colors = ['#FF0000','#00FF00','#0000FF'], color = 0, delay = 5000, scrollDelay = 1000;
function burnGuardAnimate()
{
color = ++color % 3;
var rColor = colors[color];
$burnGuard.css({
'left':'0px',
'background-color':rColor,
}).show().animate({
'left':$(window).width()+'px'
},scrollDelay,function(){
$(this).hide();
});
setTimeout(burnGuardAnimate,delay);
}
setTimeout(burnGuardAnimate,delay);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment