Bootstrap Carousel左右

时间:2014-06-07 00:37:57

标签: angularjs twitter-bootstrap carousel angular-ui-router

有人可以帮我吗?一切正常,除非你点击右边的控件进入最后一张幻灯片,当你点击左边时它总是转到第二张幻灯片,这里是代码。

<!-- BEGIN Carousel Element -->
<div class="container">
    <div id="carousel" class="carousel slide" data-ride="carousel">
        <!-- Indicators -->
        <ol class="carousel-indicators">
            <li data-target="carousel" data-slide-to="0" class="active"></li>
            <li data-target="carousel" data-slide-to="1"></li>
            <li data-target="carousel" data-slide-to="2"></li>
        </ol>
        <!-- Wrapper -->
        <div class="carousel-inner">
            <div class="item active" data-slide-number="0">
                <img src="img/lol1.jpg" alt="">
                <div class="carousel-caption">
                    <h3>Pentakill - Smite and Ignite Now Available</h3>
                </div>
            </div>
            <div class="item" data-slide-number="1">
                <img src="img/d3ros.jpg" alt="">
                <div class="carousel-caption">
                    <h3>Diablo 3</h3>
                    <p>Reaper of Souls</p>
                </div>
            </div>
            <div class="item" data-slide-number="2">
                <img src="img/twitchtv.jpg" alt="">
                <div class="carousel-caption">
                    <h3>Twitch.TV Streaming</h3>
                    <p>Coming Soon</p>
                </div>
            </div>
        </div>
        <a class="left carousel-control" href="#carousel" data-slide="prev">
            <span class="glyphicon glyphicon-chevron-left"></span>
        </a>
        <a class="right carousel-control" href="#carousel" data-slide="next">
            <span class="glyphicon glyphicon-chevron-right"></span>
        </a>
    </div>
    <script type="text/javascript" >
        $('.carousel').carousel();
    </script>
</div>

0 个答案:

没有答案