Created
July 25, 2009 11:30
-
-
Save drikin/154778 to your computer and use it in GitHub Desktop.
shadow animation on Drift Diary Title
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 alphaCounter = 1; | |
var countDirection = 1; | |
var mainStyleSheet = document.styleSheets[0]; | |
function getShadowCssText(alphaValue) { | |
return "#banner-header {text-shadow: 4px 4px 4px rgba(105, 105, 105, " + alphaValue + ") !important;}" | |
} | |
function timeout_trigger() { | |
if( alphaCounter < 0 || alphaCounter > 20 ) { | |
countDirection *= -1; | |
} | |
alphaCounter += countDirection; | |
mainStyleSheet.deleteRule(0) | |
mainStyleSheet.insertRule(getShadowCssText(alphaCounter / 10), 0) | |
setTimeout('timeout_trigger()', 100); | |
} | |
function timeout_init() { | |
mainStyleSheet.insertRule(getShadowCssText(0), 0) | |
timeout = setTimeout('timeout_trigger()', 100); | |
} | |
timeout_init(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment