Created
July 19, 2016 02:50
-
-
Save reelsense/a0cba2f24e66a4d10f28bc3f3e28f728 to your computer and use it in GitHub Desktop.
Remove burn in with magic
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 $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