Jessie-shsh 2015-12-22 17:01:44 10923次浏览 1条回复 2 0 0

在Yii框架下采用了carousel组件实现图片轮播,但是无论图片自身尺寸如何变化,在代码中设置style、width的数值,都没法改变轮播组件显示图片区域的大小,具体代码如下,请问要怎么样才能改变carousel显示区域的大小?

  <div class="img-wall" style="width:660">

        <div id="myCarousel" class="carousel slide" data-ride="carousel" data-interval="4000" >

            <ol class="carousel-indicators">
                <li data-target="#myCarousel" data-slide-to="0" class="active"></li>
                <li data-target="#myCarousel" data-slide-to="1"></li>
                <li data-target="#myCarousel" data-slide-to="2"></li>
            </ol>

            <div class="carousel-inner">
                <div class="item active">
                    <img src="<?=Url::to('@web/images/display-imgs/1.jpg')?>" alt="First slide">
                    <div class="carousel-caption">标题 1</div>
                </div>
                <div class="item">
                    <img src="<?=Url::to('@web/images/display-imgs/2.jpg')?>" alt="Second slide">
                    <div class="carousel-caption">标题 2</div>
                </div>
                <div class="item">
                    <img src="<?=Url::to('@web/images/display-imgs/3.jpg')?>" alt="Third slide">
                    <div class="carousel-caption">标题 3</div>
                </div>
            </div>

            <a class="carousel-control left" href="#myCarousel"
               data-slide="prev">&lsaquo;</a>
            <a class="carousel-control right" href="#myCarousel"
               data-slide="next">&rsaquo;</a>
        </div>
    </div>
您需要登录后才可以回复。登录 | 立即注册