bootstrap 实现轮播图
2017-11-07 23:02
113 查看
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Carousel</title> <link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css"> <style> /*调整容器大小*/ #myCarousel { width: 600px; } /*调整圆圈链接ol位置*/ .carousel-indicators { bottom: -5px; } /*调整轮播图位置*/ #carousel-example-generic { top: 100px; } </style> </head> <body> <div class="container" id="myCarousel"> <!-- 轮播图容器 --> <div id="carousel-example-generic" class="carousel slide"> <!-- 轮播图上的圆圈链接 --> <ol class="carousel-indicators radiou"> <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> <!-- 轮播图具体内容 --> <div class="carousel-inner"> <div class="item active"> <img src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1510071051013&di=fe871132a698a7e62aa1036240aa221b&imgtype=jpg&src=http%3A%2F%2Fimg.evolife.cn%2F2015-01%2Fbde62420fc3165f8_thumb.jpg" style="height: 300px; width:600px"> <!-- 图上文字 --> <div class="carousel-caption"> <h4>Red Car Fly</h4> <p>ajsuten hsdfupeia jsdtfua</p> </div> </div> <div class="item"> <img src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1510077934469&di=d7d222fb5b5465fde75425e984cf2b90&imgtype=0&src=http%3A%2F%2Fc.hiphotos.baidu.com%2Fimage%2Fpic%2Fitem%2F7a899e510fb30f2478787ac5c295d143ac4b0311.jpg" style="height: 300px; width:600px"> <!-- 图上文字 --> <div class="carousel-caption"> <h4>White Car Fly</h4> <p>ajsuten hsdfupeia jsdtfua</p> </div> </div> <div class="item"> <img src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1510077977327&di=404f5cf97186c344d0a34a343f8be5b2&imgtype=0&src=http%3A%2F%2Fimg.autofan.com.cn%2F2016-12-05%2F16%2Ff206c101380a.JPG" style="height: 300px; width:600px"> <!-- 图上文字 --> <div class="carousel-caption"> <h4>Blue Car Fly</h4> <p>ajsuten hsdfupeia jsdtfua</p> </div> </div> </div> <!-- 轮播图上的向前一图切换链接 --> <a href="#carousel-example-generic" data-slide="prev" class="left carousel-control"> <span class="glyphicon glyphicon-chevron-left"></span> </a> <!-- 轮播图上的向后一图切换链接 --> <a href="#carousel-example-generic" data-slide="next" class="right carousel-control"> <span class="glyphicon glyphicon-chevron-right"></span> </a> </div> </div> <!-- 引入jquery与bootstrap的js文件 --> <script src="http://lib.sinaapp.com/js/jquery/1.9.1/jquery-1.9.1.min.js"></script> <script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> <script> $(".carousel").carousel({ interval:2000 //每隔两秒自动轮播 }) </script> </body> </html>
相关文章推荐
- Bootstrap+JavaScript实现广告轮播
- 用bootstrap实现图片的轮播
- bootstrap下 图片轮播的实现
- 单独引用bootstrap源码的carousel.js无法实现轮播效果的解决
- BootStrap实现手机端轮播图左右滑动事件
- bootstrap 轮播图实现大小自适应
- Bootstrap实现基于carousel.js框架的轮播图效果
- (新手向)基于Bootstrap的简单轮播图的手机实现
- 在bootstrap中实现轮播图实例代码
- AngularJS+ui.bootstrap实现图片轮播
- 基于bootstrap实现广告轮播带图片和文字效果
- 基于Bootstrap实现图片轮播效果
- 利用bootstrap的carousel.js实现轮播图动画
- bootstrap实现轮播图手指左右滑动事件
- JS组件Bootstrap实现图片轮播效果
- 通过BootStrap实现轮播图的实际应用
- 轻松实现Bootstrap图片轮播
- bootstrap实现每隔5秒自动轮播效果
- 通过jQuery和Bootstrap来分别实现轮播图
- bootstrap 实现简单轮播