Last active
February 15, 2017 03:51
-
-
Save come25136/c444f9007bf326fb4ca4290dd35ee2e6 to your computer and use it in GitHub Desktop.
タイピング風に文字を表示させるjQueryプラグイン
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
(function ($) { | |
$.fn.ctyping = function (value, min, max) { | |
return this.each(function () { | |
var $this = $(this); | |
var values = value.split(""); | |
var count = 0; | |
function add() { | |
$this.append(values[count]); | |
count++; | |
if (count !== values.length) { | |
setTimeout(add, Math.floor(Math.random() * (++max - min)) + min); | |
} | |
} | |
add(); | |
}); | |
}; | |
})(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
パブリックドメインです。私用, 商用に関わらず、ご自由にお使いください。