Last active
December 25, 2015 04:09
-
-
Save meoooh/6915131 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
function twinkle(target){ | |
var opa = $(target).css("opacity"); | |
if(twinkleSwitch){ | |
$(target).css("opacity", parseFloat(opa) - 0.1); | |
if($(target).css("opacity") < 0.1){ | |
twinkleSwitch = false; | |
} | |
} | |
else{ | |
$(target).css("opacity", parseFloat(opa) + 0.1); | |
if($(target).css("opacity") == 1){ | |
twinkleSwitch = true; | |
} | |
} | |
} | |
var twinkleSwitch = true; | |
setInterval(function(){ | |
twinkle("img#sample"); | |
}, 100); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment