Last active
March 3, 2019 02:20
-
-
Save jayzhan211/7fd6e3f04f1baecc789176464745ab19 to your computer and use it in GitHub Desktop.
hexo/js/mouseclick/words
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 a_idx = 0; | |
jQuery(document).ready(function($) { | |
$("body").click(function(e) { | |
var a = new Array("傲慢", "貪婪 ", "色慾", "嫉妒", "暴食", "憤怒", "怠惰"); | |
var $i = $("<span/>").text(a[a_idx]); | |
a_idx = (a_idx + 1) % a.length; | |
var x = e.pageX, | |
y = e.pageY; | |
$i.css({ | |
"z-index": 999999999999999999999999999999999999999999999999999999999999999999999, | |
"top": y - 20, | |
"left": x, | |
"position": "absolute", | |
"font-weight": "bold", | |
"color": "#000000" | |
}); | |
$("body").append($i); | |
$i.animate({ | |
"top": y - 180, | |
"opacity": 0 | |
}, | |
1500, | |
function() { | |
$i.remove(); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment