我需要像这样创建动态引导轮播:
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
<li data-target="#carousel-example-generic" data-slide-to="1"></li>
etc...
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner">
<div class="item active">
<img src="someIMG.jpg" alt="...">
</div>
<div class="item">
<img src="someIMG-nn.jpg" alt="...">
</div>
etc...
</div>
<!-- Controls -->
<a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left"></span>
</a>
<a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right"></span>
</a>
</div>
现在我有一个 osclass 函数,我调用它来创建动态引导轮播:
**<?php osc_run_hook('item_detail', osc_item() ) ; ?>
<?php if( osc_images_enabled_at_items() && (osc_count_item_resources() > 0) ) { ?>**
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<ol class="carousel-indicators">
**<?php $i=0;?>**
**<?php while( osc_has_item_resources() ) { ?>**
<li data-target="#carousel-example-generic" data-slide-to="**<?php echo $i; $i+1;?>**" class="active"></li>
**<?php } ?>**
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner">
**<?php while( osc_has_item_resources() ) { ?>**
<div class="item">
<img src="**<?php echo osc_resource_url(); ?>**" alt="...">
</div>
**<?php } ?>**
</div>
<!-- Controls -->
<a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left"></span>
</a>
<a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right"></span>
</a>
</div>
我是初学者,所以我不知道这里有什么问题。在我的逻辑中,我认为我写得很好,但我写的东西不起作用......两个时间是问题还是别的什么?
请帮忙,对不起我的英语。谢谢!