Skip to content

Instantly share code, notes, and snippets.

@yamitake
Created April 30, 2012 07:39
Show Gist options
  • Select an option

  • Save yamitake/2556305 to your computer and use it in GitHub Desktop.

Select an option

Save yamitake/2556305 to your computer and use it in GitHub Desktop.
テキストを長そうとしたけ
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