0

谁能帮我举个例子,说明当轮播项目处于活动状态时如何启动动画。

我正在使用 daneden.me/animate/‎他的 css,动画在下一个项目被触发后立即开始。现在我想要的是让它在幻灯片完成后开始。

这是我的 HTML

<div class="item active">               
    <div class="row" style="position:relative;">
        <div class="col-lg-6">
            <h1 class="animated fadeInLeft">Bespaar kosten met een overstap naar LED!</h1>
               <div class="lead">
               <p class="animated fadeInLeft animation-delay-hs">
                  Met LED verlichting bespaard u al snel <strong>40 tot 60%</strong> op uw energy kosten. <strong>wat LED u?</strong>
               </p>
               <a href="#" class="animated animation-delay-hs fadeInLeft btn btn-default btn-large">Vraag een offerte op maat aan</a>
                 <a href="#" class="animated animation-delay-hs fadeInLeft btn btn-warning btn-large">Lees meer</a>
               </div>
        </div>
        <div class="col-lg-6 hero-led" style="position:absolute; bottom:0; right: 0;">
            <img src="img/hero-1.png" class="animated fadeInRightBig img-responsive hero-led-light" alt="">
            <img src="img/hero-1-light.png" class="animation-delay-2s hero-light-delay animated fadeIn img-responsive" alt="">
            <img src="img/hero-1-light-2.png" class="animation-delay-3s hero-light-delay animated fadeIn img-responsive" alt="">
            <img src="img/hero-1-light-3.png" class="animation-delay-4s hero-light-delay animated fadeIn img-responsive" alt="">
        </div>
     </div>
 </div>

css 是从daneden的 animated.css 加载的。

4

1 回答 1

5

当我读到您的问题并查看您的 html 代码时。我不明白为什么你的过渡班已经在里面了。

对于过渡,您必须从隐藏元素开始(不透明度:0;)。在此之后添加过渡类,使其具有某种效果可见。https://github.com/daneden/animate.css展示了如何使用 jQuery 做到这一点。

我认为你应该做这样的事情。为某些幻灯片创建轮播和过渡。运行轮播,在过渡幻灯片处停止,播放过渡并重新启动轮播。

第二张幻灯片上的过渡示例(索引 = 1):

$('.carousel').carousel();

$(".carousel").on('slid.bs.carousel', function(evt) {
      if( $(this).find('.active').index() == 1)
      {
            $(this).carousel('pause');

            /* run your transitions */
            transitions();

            /*restart your carousel */
      }   
});

找到活动幻灯片的索引:https ://stackoverflow.com/a/18690905/1596547 停止(并重新启动)您的轮播:https ://stackoverflow.com/a/14753680/1596547

过渡

Bootstrap 附带了 transition.js,您可以使用它为您的代码添加一些后备。为了防止您的代码在转换运行时运行,您需要在超时时添加它。请参阅:jQuery/Javascript - 如何在继续执行函数之前等待被操纵的 DOM 更新

例如创建此功能:

        function transitions()
        {
        var j = 1;
        for(var i=1; i<=4; i++)
        {
            setTimeout(   
            function()
            {
                    if (!$.support.transition){$('#z'+i).removeClass('inactive')}
                    else
                    {

                    $('#z'+j).addClass('animated').addClass('fadeInLeft');
                    $('#z'+j).one($.support.transition.end, function(){$('#z'+i).removeClass('inactive')}).emulateTransitionEnd(2000);
                    }
                    j++
            },
            2000*(i-1));
        }
        }

此代码为每个 z* 元素添加转换类。下一个转换在第一个转换后 2 秒(超时 2000 毫秒)开始。

html

           <p class="inactive" id="z1">
              Met LED verlichting bespaart u al snel <strong>40 tot 60%</strong> op uw energie kosten. <strong>wat LED u?</strong>
           </p>
           <p class="inactive" id="z2">
              Met LED verlichting bespaart u al snel <strong>40 tot 60%</strong> op uw energie kosten. <strong>wat LED u?</strong>
           </p>   
           <p class="inactive" id="z3">
              Met LED verlichting bespaart u al snel <strong>40 tot 60%</strong> op uw energie kosten. <strong>wat LED u?</strong>
           </p>   
           <div class="inactive" id="z4">
               <a href="#" class="btn btn-default btn-large">Vraag een offerte op maat aan</a>
           </div>

CSS

        //hide the z* elements
        .inactive{opacity:0;}

重新开始

由于上面的代码执行了 2 秒的 4 次转换,轮播将在 5 x 2 秒后重新启动:

        var that = $(this);
        /*restart your carousal */
        setTimeout(function(){

            that.carousel('next');
            that.carousel('cycle');

            /* hide transitions again */
            $("#slide2 [id^='z']").removeClass().addClass('inactive');


            },2000*5);

例子:

见:http ://bootply.com/83200

完整代码:

 <!DOCTYPE html>
 <html>
 <head>
 <title>Carousel with transitions</title>
 <meta name="viewport" content="width=device-width, initial-scale=1.0">
 <!-- Bootstrap -->
    <style type="text/css">
    </style>
<link href="/bootstrap3/bootstrap-master/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="/animate.min.css" rel="stylesheet">
 <style>
body {padding-top:80px;}
.inactive{opacity:0;}


 </style>    
    </head>
<body>
<header class="navbar  navbar-default navbar-fixed-top" role="banner">
<div class="col-10">
<div class="container">
  <div class="navbar-header">
    <button class="navbar-toggle" type="button" data-toggle="collapse" data-target=".navbar-ex1-collapse">
      <span class="sr-only">Toggle navigation</span>
      <span class="icon-bar"></span>
      <span class="icon-bar"></span>
      <span class="icon-bar"></span>
    </button>
      <a class="navbar-brand" href="#">Logo Text</a>
  </div>

  <nav class="collapse navbar-collapse navbar-ex1-collapse" role="navigation">
    <ul class="nav navbar-nav navbar-right">
      <li class="home_button"> <a href="#"> <span class="glyphicon glyphicon-home"></span> </a> </li>
      <li class="dropdown">
        <a href="#" class="dropdown-toggle" data-toggle="dropdown"><b class="caret"></b></a>
        <ul class="dropdown-menu">
          <li> <a href="#" > My Account </a> </li><br>
          <li> <a href="#"> Logout </a> </li>
        </ul>
      </li>
    </ul>
  </nav>
  </div>
</div>
</header>   

<div class="container" style="max-width:900px;">

      <div id="carousel-example-captions" class="carousel slide bs-docs-carousel-example">
        <ol class="carousel-indicators">
          <li data-target="#carousel-example-captions" data-slide-to="0" class="active"></li>
          <li class="" data-target="#carousel-example-captions" data-slide-to="1"></li>
          <li class="" data-target="#carousel-example-captions" data-slide-to="2"></li>
        </ol>
        <div class="carousel-inner">
          <div class="item active">
            <img data-src="holder.js/900x500/auto/#777:#777" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA4QAAAH0CAYAAABl8+PTAAALGUlEQVR4nO3XoQEAMAyAsH7d87czKoiIxzK7+wAAAOiZ6wAAAABuGEIAAIAoQwgAABBlCAEAAKIMIQAAQJQhBAAAiDKEAAAAUYYQAAAgyhACAABEGUIAAIAoQwgAABBlCAEAAKIMIQAAQJQhBAAAiDKEAAAAUYYQAAAgyhACAABEGUIAAIAoQwgAABBlCAEAAKIMIQAAQJQhBAAAiDKEA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AiDKEAAAAUYYQAAAgyhACAABEGUIAAIAoQwgAABBlCAEAAKIMIQAAQJQhBAAAiDKEAAAAUYYQAAAgyhACAABEGUIAAIAoQwgAABBlCAEAAKIMIQAAQJQhBAAAiDKEAAAAUYYQAAAgyhACAABEGUIAAIAoQwgAABBlCAEAAKIMIQAAQJQhBAAAiDKEAAAAUYYQAAAgyhACAABEGUIAAIAoQwgAABBlCAEAAKIMIQAAQJQhBAAAiDKEAAAAUYYQAAAgyhACAABEGUIAAIAoQwgAABBlCAEAAKIMIQAAQJQhBAAAiDKEAAAAUYYQAAAgyhACAABEGUIAAIAoQwgAABD1AcvKO4a+zjA6AAAAAElFTkSuQmCC" alt="900x500">
            <div class="carousel-caption">
              <h3>First slide label</h3>
              <p>Nulla vitae elit libero, a pharetra augue mollis interdum.</p>
            </div>
          </div>
          <div class="item" id="slide2">
            <img data-src="holder.js/900x500/auto/#666:#666" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA4QAAAH0CAYAAABl8+PTAAALGklEQVR4nO3XIQEAMAzAsKmdfwe/jIEGhJd2dvcBAADQM9cBAAAA3DCEAAAAUYYQAAAgyhACAABEGUIAAIAoQwgAABBlCAEAAKIMIQAAQJQhBAAAiDKEAAAAUYYQAAAgyhACAABEGUIAAIAoQwgAABBlCAEAAKIMIQAAQJQhBAAAiDKEAAAAUYYQAAAgyhACAABEGUIAAIAoQwgAABBlCAEAAKIMIQAAQJQhBAAAiDKEAAAAUYYQAAAgyhACAABEGUIAAIAoQwgAABBlCAEAAKIMIQAAQJQhBAAAiDKEAAAAUYYQAAAgyhACAABEGUIAAIAoQwgAABBlCAEAAKIMIQAAQJQhBAAAiDKEAAAAUYYQAAAgyhACAABEGUIAAIAoQwgAABBlCAEAAKIMIQAAQJQhBAAAiDKEAAAAUYYQAAAgyhACAABEGUIAAIAoQwgAABBlCAEAAKIMIQAAQJQhBAAAiDKEAAAAUYYQAAAgyhACAABEGUIAAIAoQwgAABBlCAEAAKIMIQAAQJ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IQAAQJQhBAAAiDKEAAAAUYYQAAAg6gP2OvaFOB4oKwAAAABJRU5ErkJggg==" alt="900x500">
            <div class="carousel-caption">
              <h3>Second slide label</h3>
               <p class="inactive" id="z1">
                  Met LED verlichting bespaart u al snel <strong>40 tot 60%</strong> op uw energie kosten. <strong>wat LED u?</strong>
               </p>
               <p class="inactive" id="z2">
                  Met LED verlichting bespaart u al snel <strong>40 tot 60%</strong> op uw energie kosten. <strong>wat LED u?</strong>
               </p>   
               <p class="inactive" id="z3">
                  Met LED verlichting bespaart u al snel <strong>40 tot 60%</strong> op uw energie kosten. <strong>wat LED u?</strong>
               </p>   
               <div class="inactive" id="z4">
                   <a href="#" class="btn btn-default btn-large">Vraag een offerte op maat aan</a>
               </div>
            </div>
          </div>
          <div class="item">
            <img data-src="holder.js/900x500/auto/#555:#5555" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA4QAAAH0CAYAAABl8+PTAAALGklEQVR4nO3XIQEAMAzAsJmcfym/jIEGhJd2dvcBAADQM9cBAAAA3DCEAAAAUYYQAAAgyhACAABEGUIAAIAoQwgAABBlCAEAAKIMIQAAQJQhBAAAiDKEAAAAUYYQAAAgyhACAABEGUIAAIAoQwgAABBlCAEAAKIMIQAAQJQhBAAAiDKEAAAAUYYQAAAgyhACAABEGUIAAIAoQwgAABBlCAEAAKIMIQAAQJQhBAAAiDKEAAAAUYYQAAAgyhACAABEGUIAAIAoQwgAABBlCAEAAKIMIQAAQJQhBAAAiDKEAAAAUYYQAAAgyhACAABEGUIAAIAoQwgAABBlCAEAAKIMIQAAQJQhBAAAiDKEAAAAUYYQAAAgyhACAABEGUIAAIAoQwgAABBlCAEAAKIMIQAAQJQhBAAAiDKEAAAAUYYQAAAgyhACAABEGUIAAIAoQwgAABBlCAEAAKIMIQAAQJQhBAAAiDKEAAAAUYYQAAAgyhACAABEGUIAAIAoQwgAABBlCAEAAKIMIQAAQJQhBAAAiDKEAAAAUYYQAAAgyhACAABEGUIAAIAoQwgAAB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AABJRU5ErkJggg==" alt="900x500">
            <div class="carousel-caption">
              <h3>Third slide label</h3>
              <p>Praesent commodo cursus magna, vel scelerisque nisl consectetur.</p>
            </div>
          </div>
        </div>
        <a class="left carousel-control" href="#carousel-example-captions" data-slide="prev">
          <span class="icon-prev"></span>
        </a>
        <a class="right carousel-control" href="#carousel-example-captions" data-slide="next">
          <span class="icon-next"></span>
        </a>
      </div>

</div>



<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>    
<script src="/bootstrap3/bootstrap-master/dist/js/bootstrap.js"></script>
<script>

function transitions()
{
var j = 1;
for(var i=1; i<=4; i++)
{
    setTimeout(   
    function()
    {
            if (!$.support.transition){$('#z'+i).removeClass('inactive')}
            else
            {

            $('#z'+j).addClass('animated').addClass('fadeInLeft');
            $('#z'+j).one($.support.transition.end, function(){$('#z'+i).removeClass('inactive')}).emulateTransitionEnd(2000);
            }
            j++
    },
    2000*(i-1));
}
}       

$('.carousel').carousel();

$(".carousel").on('slid.bs.carousel', function(evt) {
  if( $(this).find('.active').index() == 1)
  {
            $(this).carousel('pause');

            /* run your transitions */
            transitions();
            var that = $(this);
            /*restart your carousal */
            setTimeout(function(){

                that.carousel('next');
                that.carousel('cycle');

                /* hide transitions again */
                $("#slide2 [id^='z']").removeClass().addClass('inactive');


                },2000*5);
  }   
});


</script>

</body>
</html>
于 2013-09-25T19:27:54.107 回答