var id = 1;
var lala = new Array(
'Hello World',
'This is my new and fancy console!',
'See how its typing?',
'Isn\'t that cool ? ',
'Try it out for yourself!');
lala.each(function (line) {
id++;
fullID = 'Div' + id;
new Element('p', {
'id': fullID
}).inject($(document.body));
texttype(fullID, line, 100, 100);
});
我试图在每个循环中调用 MooTools 中的一个方法,但问题是由于 javascripts 的性质,所有方法调用都是在 aprox 处调用的。同时。我该如何防止这种情况发生?我需要从我调用的方法中返回一些东西吗?还有其他方法吗?由于时间问题,任意超时似乎并不是一个好的解决方案。(注意,这段代码处于测试阶段,所以它的数据和变量名是假的)