所以我想在我的页面中实现上面的轮播,似乎有很多问题。相关网页是:http://wasup.si/test-bid1
如你所见它看起来甚至没有启动......没有任何控制台错误。任何人都可以帮我解决我做错的事吗?
<!-- Carousel
================================================== -->
<div id="myCarousel" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<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">
<?php
$query = "select * from bcuPhoto where ID_bcu='".$BID."' and published=1";
dbOpen2($query);
$i=1;
while (dbGetRow2()) {
$image = Image::getInstance();
$pic_big = $image->img(row2('source'),"media/uploads/bcuPhoto/",1170,600,false);
unset($image);
?>
<div class="item<?php if ($i== 1) print " active"?>">
<img src="<?php print $pic_big?>" class="img-responsive" border="0" title="<?php print row2('title')." - ".$i?>">
</div>
<?php
$i++;
}
dbClose2();
?>
</div>
<a class="left carousel-control" href="#myCarousel" data-slide="prev"><span class="glyphicon glyphicon-chevron-left"></span></a>
<a class="right carousel-control" href="#myCarousel" data-slide="next"><span class="glyphicon glyphicon-chevron-right"></span></a>
</div><!-- /.carousel -->
这是用于旋转木马的代码...
答案 0 :(得分:1)
CSS:
#myCarousel
{
height:300px; //set the height
width:100%; //set width accordingly
}
它会让它发挥作用。否则,代码中没有问题。