English 中文(简体)
我如何利用缺陷 在美元内(......)
原标题:how can I use fadeTo inside $(element).each(...)
  • 时间:2012-04-24 23:57:34
  •  标签:
  • jquery
  • loops

我有一些小iv,我想利用每一套 j子,穿透四肢,并想对每 d一带单独施加影响。 更清楚的是,我想ive到0.5(城市)之后,拖延(300)又再次失败。 回到1(城市)之后,我希望每一方都这样做。 任何人都可以向我展示正确的方式。 感谢。

Code is in a fiddle.

最佳回答
问题回答

我总是认为,最好使用消化完成功能,而不是多种不同的协调时间,因为它保证了连续的性质。 这里我是这样做的:

function fadeElementsSequential(selector) {
    var elems$ = $(selector);
    var i = 0;
    function next() {
        if (i < elems$.length) {
            elems$.eq(i++).fadeTo(1000, 0.5).delay(300).fadeTo(1000, 1, next);
        }
    }
    next();
}

fadeElementsSequential(".box");

http://jsfiddle.net

Note: I changed the opacity values in the demo just to make it a little more visible.





相关问题
getGridParam is not a function

The HTML: <a href="javascript:void(0)" id="m1">Get Selected id s</a> The Function: jQuery("#m1").click( function() { var s; s = jQuery("#list4").getGridParam( selarrrow )...

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.

jQuery cycle page with links

I am using the cycle plugin with pager functionality like this : $j( #homebox ) .cycle({ fx: fade , speed: fast , timeout: 9000, pager: #home-thumbs , ...

jquery ui dialog opens only once

I have a button that opens a dialog when clicked. The dialog displays a div that was hidden After I close the dialog by clicking the X icon, the dialog can t be opened again.

jConfirm with this existing code

I need help to use jConfirm with this existing code (php & Jquery & jAlert). function logout() { if (confirm("Do you really want to logout?")) window.location.href = "logout.php"; } ...

Wrap text after particular symbol with jQuery

What I m trying to do, is wrap text into div inside ll tag. It wouldn t be a problem, but I need to wrap text that appears particularly after "-" (minus) including "minus" itself. This is my html: &...

热门标签