【问题标题】:fadeIn some div one by one using jquery使用jquery一一淡入一些div
【发布时间】:2014-06-30 09:41:39
【问题描述】:

我有 8 个 div 。我希望当页面准备好时,每个 div 都会淡入页面,然后是下一个.... 我试过这个,但所有的 div 一起淡入页面。我该怎么做? 谢谢

 <div class="parts" id="div1">
        <img src="images/home_title.png" alt="" />
 </div>
 <div class="parts" id="div2">
       <img src="images/call_title.png" alt="" width="150px" height="40px" />
 </div>
 <div class="parts" id="div3">
       <img src="images/about_title.png" alt="" width="150px" height="40px" />
 </div>
 <div class="parts" id="div4">
       <img src="images/about_title.png" alt="" width="150px" height="40px" />
 </div>
 <div class="parts" id="div5">
       <img src="images/about_title.png" alt="" width="150px" height="40px" />
 </div>
 <div class="parts" id="div6">
       <img src="images/about_title.png" alt="" width="150px" height="40px" />
 </div>
 <div class="parts"  id="div7">
    <img src="images/about_title.png" alt="" width="150px" height="40px" />
 </div>
 <div class="parts" id="div8">
    <img src="images/about_title.png" alt="" width="150px" height="40px" />
 </div>

和jquery:

  $(document) .ready(function(){
     $(".parts").each(function(){
         $(this).fadeIn();
     });
  });

【问题讨论】:

标签: jquery


【解决方案1】:

试试这个

$(".parts").each(function(index) {
    $(this).delay(400*index).fadeIn(300);
});

DEMO

$('.parts').each(function(i) {
    $(this).hide().delay(i * 3500).fadeIn(1500);
});

DEMO

【讨论】:

  • @IVIAjid 很高兴帮助你>:-)
猜你喜欢
  • 1970-01-01
  • 2013-11-04
  • 1970-01-01
  • 1970-01-01
  • 2012-07-08
  • 1970-01-01
  • 2015-08-30
  • 1970-01-01
  • 2012-10-29
相关资源
最近更新 更多