PHPOK 调用bootstrap 自适应轮播图的方法。
2015-02-04 10:14
393 查看
首页网页中要引入bootstrap 的文件
<link rel="stylesheet" type="text/css" href="images/bootstrap.min.css" />
<script src="images/jquery.1.9.1.min.js"></script>
//然后轮播放图部分
<style type="text/css">
/***轮播图***/
.carousel-control.right { background-image: none; }
.carousel-control.left { background-image: none; }
.bs-example .btnr{width:46px; height:100%; background:url(btnlr.png) no-repeat right center;}
.bs-example .btnl{width:46px; height:100%; background:url(btnlr.png) no-repeat left center;}
.carousel-indicators li{width:11px; height:11px; background:url(01.png) no-repeat left; margin:0 10px; border:0px; }
.carousel-indicators li.active{background:url(01.png) no-repeat right; margin:0 10px;width:11px; height:11px;}
</style>
<div class="bs-example">
<div id="myCarousel" class="carousel slide" data-ride="carousel">
<ol class="carousel-indicators">
<!-- run:$tags = phpok_c_list("shouyehuandengpian",99) -->
<!-- $tags[rslist] AS $key=>$v -->
<li data-target="#myCarousel" data-slide-to=""></li>
<!-- end -->
<!-- run:unset($tags) -->
</ol>
<div class="carousel-inner" role="listbox">
<!-- run:$tags = phpok_c_list("shouyehuandengpian",99) -->
<!-- $tags[rslist] AS $key=>$v -->
<div class="item"><img data-holder-rendered="true" src="{:$v[picture]}"> </div>
<!-- end -->
<!-- run:unset($tags) -->
</div>
<a class="right carousel-control" href="#myCarousel" role="button" data-slide="prev">
<span class="glyphicon btnr"></span>
</a>
<a class="left carousel-control" href="#myCarousel" role="button" data-slide="next">
<span class="glyphicon btnl"></span>
</a>
</div>
</div>
<script type="text/javascript">
$(".carousel-indicators li:first").addClass("active");
$(".carousel-inner div:first").addClass("active");
<!-- run:$tags = phpok_c_list("shouyehuandengpian",99) -->
<!-- $tags[rslist] AS $key=>$v -->
$(".carousel-indicators li").each(function(index, element) {
$(this).attr("data-slide-to",$(this).index());
});
<!-- end -->
<!-- run:unset($tags) -->
</script>
<link rel="stylesheet" type="text/css" href="images/bootstrap.min.css" />
<script src="images/jquery.1.9.1.min.js"></script>
//然后轮播放图部分
<style type="text/css">
/***轮播图***/
.carousel-control.right { background-image: none; }
.carousel-control.left { background-image: none; }
.bs-example .btnr{width:46px; height:100%; background:url(btnlr.png) no-repeat right center;}
.bs-example .btnl{width:46px; height:100%; background:url(btnlr.png) no-repeat left center;}
.carousel-indicators li{width:11px; height:11px; background:url(01.png) no-repeat left; margin:0 10px; border:0px; }
.carousel-indicators li.active{background:url(01.png) no-repeat right; margin:0 10px;width:11px; height:11px;}
</style>
<div class="bs-example">
<div id="myCarousel" class="carousel slide" data-ride="carousel">
<ol class="carousel-indicators">
<!-- run:$tags = phpok_c_list("shouyehuandengpian",99) -->
<!-- $tags[rslist] AS $key=>$v -->
<li data-target="#myCarousel" data-slide-to=""></li>
<!-- end -->
<!-- run:unset($tags) -->
</ol>
<div class="carousel-inner" role="listbox">
<!-- run:$tags = phpok_c_list("shouyehuandengpian",99) -->
<!-- $tags[rslist] AS $key=>$v -->
<div class="item"><img data-holder-rendered="true" src="{:$v[picture]}"> </div>
<!-- end -->
<!-- run:unset($tags) -->
</div>
<a class="right carousel-control" href="#myCarousel" role="button" data-slide="prev">
<span class="glyphicon btnr"></span>
</a>
<a class="left carousel-control" href="#myCarousel" role="button" data-slide="next">
<span class="glyphicon btnl"></span>
</a>
</div>
</div>
<script type="text/javascript">
$(".carousel-indicators li:first").addClass("active");
$(".carousel-inner div:first").addClass("active");
<!-- run:$tags = phpok_c_list("shouyehuandengpian",99) -->
<!-- $tags[rslist] AS $key=>$v -->
$(".carousel-indicators li").each(function(index, element) {
$(this).attr("data-slide-to",$(this).index());
});
<!-- end -->
<!-- run:unset($tags) -->
</script>
相关文章推荐
- php打包zip文件,完整实例(附类,附调用方法),已经测试OK的
- PHP调用三种数据库的方法(3)
- PHP调用三种数据库的方法(1)
- PHP调用三种数据库的方法(1)
- 用PHP调用Oracle存储过程的方法
- 两种php调用Java对象的方法
- php调用mysql存储过程和函数的方法
- php中运用http调用的GET和POST方法
- php调用mysql存储过程和函数的方法
- php调用java对象方法(转)
- PHP生成静态页面代码和调用方法
- Zend studio for eclipse中使php可以调用mysql相关函数的设置方法
- 两种php调用Java对象的方法
- PHP调用三种数据库的方法(1)
- php调用 java类的方法
- PHP调用三种数据库的方法(2)
- 比较两种php调用Java对象的方法
- PHP中通过ADO调用Access数据库的方法测试不通过
- 两种php调用Java对象的方法
- php调用C代码的方法详解