English 中文(简体)
页: 1 child育儿童元素
原标题:jQuery looped animation for child elements

Afternoon all!

我要定期强调一份小小小块浮小块。 基本上,Im试图展示工作流程。 我利用 j,希望:

  1. Get the first child of the parent div (#general process)
  2. Add a class (i.e highlight) which changes the CSS
  3. Add a short delay
  4. Remove the highlight class
  5. Find the next child item (if last to return to the first) and repeat steps 2-4

www.un.org/Depts/DGACM/index_spanish.htm 我试图通过这一途径预示我,但继续失败。 谁能提出实现这种 lo死的最佳途径? 事先感谢任何建议!

Here is my current HTML & CSS:

<div id="general_process"> 
    <div class="phase"> 
        <div class="number">1</div> 
        <h3>Some title</h3> 
        <p>Content goes here</p> 
    </div> 
    <div class="phase"> 
        <div class="number">2</div> 
        <h3>Some title</h3> 
        <p>Content goes here</p> 
    </div> 
    <div class="phase"> 
        <div class="number">3</div> 
        <h3>Some title</h3> 
        <p>Content goes here</p> 
    </div> 
</div>

#general_process  {margin: 0; padding: 0; }
#general_process div.phase {  float: left; padding: 10px 25px; background: #f9f9f9; width: 254px; border: 1px soild #999999;}
最佳回答
(function (elements) {

    var i = -1;
    var className =  highlighted ;

    if (!elements.length) {
        return false;
    }

    function step() {
        elements.eq(i).removeClass(className);

        if (++i >= elements.length) {
            i = 0;
        };

        elements.eq(i).addClass(className);

        setTimeout(step, 3000);
    }

    step();

}($( #general_process ).children()));

我们利用封锁实现我们用来跟踪国家的所有变量。

然后,我们有一个职能<条码>分步骤>,每3秒钟执行......如果我们现在重新讨论,它就会把这一类别从目前的要素中删除,回到第一个要素上,然后将这一类别增加到目标要素。

http://jsfiddle.net/UnBbF/"rel=“nofollow> 性别观

问题回答

暂无回答




相关问题
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: &...

热门标签