Last active
August 29, 2015 14:26
-
-
Save tomauty/aa9cc3cc87bc61840d73 to your computer and use it in GitHub Desktop.
lol2.js
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
// hover | |
var i = undefined; | |
$('a').mouseover(function() { | |
var dest = $(this); | |
var string = dest.text(); | |
var c = 0; | |
dest.text(''); | |
i = setInterval(function () { | |
if (c >= string.length) { | |
clearInterval(i); | |
dest.text(string); | |
} else { | |
$('<span>').text(string[c]) | |
.appendTo(dest).hide().fadeIn(100); | |
c += 1; | |
console.log(string[c]); | |
} | |
}, 50); | |
}).mouseout(function() { | |
clearInterval(i); | |
c = 0; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment