English 中文(简体)
用一页的几句 words子对它撒谎?
原标题:Coffeescript to iterate through an array of words on a page?

我用一页来重复我所希望的几句话,使现有的字句轮流,新字则轮流。

使用的Immate.css通过添加和删除一个类别处理 an。

最初的四级有门类<代码>。 载于,因此,在网页上加注。 它还有一个<代码>。

在第二次推迟之后,我添加了“出勤”类别<代码>。 然后从上删除起门类,从而引发离去im。 此时此刻,四分五裂是隐蔽的。

我修改了案文,接着增加了门槛,然后取消了离职班,引起进口量升值。

一旦我打上了阵列的最后一句话,该功能就停止了。

什么是用咖啡字母写这句话的最佳途径,以便我能够缩短进口和出境之间的时间?

<>strong>EDIT: here s some basic javascript Code show what Imtries to do. 我愿重写这段话,以便我能够树立一系列的“条码”[oo,条条码],而不是下文中脆弱的“快车道”。

var $adj = $( #adjectives );

setTimeout(function() {
$adj.addClass( rotateOut );
setTimeout(function() {
    $adj.removeClass( rotateIn );
    setTimeout(function() {
        $adj.text( foo );
        $adj.addClass( rotateIn );
        setTimeout(function() {
            $adj.removeClass( rotateOut );
            setTimeout(function() {
                $adj.addClass( rotateOut );
                setTimeout(function() {
                    $adj.removeClass( rotateIn );
                    setTimeout(function() {
                        $adj.text( bar );
                        $adj.addClass( rotateIn );
                    }, 1000);
                }, 1000);
            }, 1000);
        }, 1000);
    }, 1000);
}, 1000);
}, 1000);
最佳回答

你们不应每次打断时间,而是应尝试在你到达之前用交火。 举一个例子,然后在你的额外范围内添加估算。

words = ["hey", "just", "testing", "this", "out"]
i = 0
len = words.length

callback = ->
    clearInterval timer if i is len - 1
    console.log words[i]
    i++
    return

timer = setInterval callback, 1000

Just for clarity s sake, here is the compiled JS

(function() {
  var callback, i, len, timer, words;
  words = ["hey", "just", "testing", "this", "out"];
  i = 0;
  len = words.length;

  callback = function() {
    if (i === len - 1) clearInterval(timer);
    console.log(words[i]);
    i++;
  };

  timer = setInterval(callback, 1000);
}).call(this);
问题回答

暂无回答




相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签