-
-
Save yamitake/2556305 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
| var opts = {}; | |
| opts.delayTime = 2000; | |
| opts.delayTime = 30; | |
| //text を流す | |
| var ticker = function(selector , text){ | |
| var target = $(selector); | |
| var len = text.length; | |
| var str = text; | |
| var i = 0; | |
| target.html(""); | |
| function next(event){ | |
| target.append(str[i++]); | |
| if(i <= len){ | |
| setTimeout(next , opts.delayTime); | |
| } | |
| } | |
| next(); | |
| }; | |
| ticker("#target" , "流したい文字列です。"); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment