javascript - How do you make words type out from a list? ex. instructables.com -
i'm trying create similar "let make"_ words typed out list on http://www.instructables.com/.
tried searching here or google "random word list" , similar terms not getting anywhere.
would appreciate guidance on what language or function used create that.
something (http://jsfiddle.net/arsyj/) may point in right direction:
var arrwordslist = ["ice cream", "bikes", "jewelry"]; var icurrentwordindex = 0; var icurrentletterindex = 0; var iintervalid; function startprintwords(iinterval) { iintervalid = setinterval(printwords, iinterval); } function stopprintwords() { clearinterval(iintervalid); } function printwords() { if(icurrentwordindex + 1 > arrwordslist.length) { stopprintwords(); return; } var strcurrenttext = $("#textbox").val(); var strcurrentword = arrwordslist[icurrentwordindex]; $("#textbox").val(strcurrenttext + strcurrentword.charat(icurrentletterindex)); if(strcurrentword.length == icurrentletterindex) { icurrentletterindex = 0; icurrentwordindex++; $("#textbox").val(""); } else { icurrentletterindex++; } } $(document).ready(function () { startprintwords(1000); });
Comments
Post a Comment