Bootstrap图片轮播
来源:互联网 发布:怎样打开网络授权 编辑:程序博客网 时间:2024/05/01 01:24
Bootstrap提供了carousel插件,实现图片轮播非常方便。
代码
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Document</title> <link href="http://libs.baidu.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet"> <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script> <script src="http://libs.baidu.com/bootstrap/3.0.3/js/bootstrap.min.js"></script> <style type="text/css"> img{ margin:0 auto; } </style></head><body> <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> <li data-target="#carousel-example-generic" data-slide-to="2"></li> </ol> <!-- Wrapper for slides --> <div class="carousel-inner" role="listbox"> <div class="item active"> <img src="images/lunbo1.jpg" height="266" width="800" alt="..."> <div class="carousel-caption"> ... </div> </div> <div class="item"> <img src="images/lunbo2.jpg" height="266" width="800" alt="..."> <div class="carousel-caption"> ... </div> </div> <div class="item"> <img src="images/lunbo3.jpg" height="266" width="800" alt="..."> <div class="carousel-caption"> ... </div> </div> ... </div> <!-- Controls --> <a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev"> <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span> <span class="sr-only">Previous</span> </a> <a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next"> <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span> <span class="sr-only">Next</span> </a></div></body></html>
效果
可选参数
- data-ride=”carousel”:加上可以自动播放,不加点击后才会播放。
- 添加标题
标题写在<div class="carousel-caption"></div>
之间
例如:
<div class="carousel-caption"> <h3>果壳推书正式上线</h3> <p>好书分享、经验交流</p></div>
官网:http://v3.bootcss.com/javascript/#carousel
2 0
- bootstrap图片轮播
- Bootstrap图片轮播
- Bootstrap图片轮播
- 【BootStrap】图片轮播
- BootStrap图片轮播
- Bootstrap 图片轮播
- Bootstrap图片轮播
- Bootstrap---图片轮播
- bootstrap图片轮播
- BootStrap图片轮播做法
- bootstrap实现图片轮播
- 【Bootstrap】图片轮播组件Carousel
- bootstrap 旋转木马carousel 图片轮播
- AngularJS+ui.bootstrap实现图片轮播
- bootstrap下 图片轮播的实现
- bootstrap图片轮播+导航栏效果
- Bootstrap的图片轮播示例代码
- 全面解析Bootstrap图片轮播效果
- Intent和IntentFilter详解
- 控制Elasticsearch分片和副本的分配
- 转 史上最完整交互设计基本原则
- Label表情for属性的用处
- Session 与 Cookie
- Bootstrap图片轮播
- Android用ImageView显示本地和网上的图片(转)
- load-on-startup在web.xml中的含义
- android程序网络连接是否可用
- 转 即使被拖库,也可以保证密码不泄露
- iOS 新手指引在App中的添加,第一次启动应用程序出现,后面都不出现
- rfkill: WLAN hard blocked
- 并发和并行的区别
- 【转载】 C++中this指针的用法详解