<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootstrap 轮播图</title>
<link href="lib/bootstrap/css/bootstrap.css" rel="stylesheet">
<!--[if lt IE 9]>
<script src="//cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="//cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
<![endif]--> <style>
img {
width: 100%;
height: 100%;
}
p {
text-align: center;
}
</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="data:images/轮播1.png" alt="轮播图1">
<div class="carousel-caption">
轮播图1
</div>
</div>
<div class="item">
<img src="data:images/轮播2.png" alt="轮播图2">
<div class="carousel-caption">
轮播图2
</div>
</div>
<div class="item">
<img src="data:images/轮播3.png" alt="轮播图3">
<div class="carousel-caption">
轮播图3
</div>
</div>
<p>轮播图尝试</p>
</div> <!-- Controls -->
<!-- 控制 -->
<!-- 向左滑动 -->
<a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left" aria-hidden="false"></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> <!-- js控制轮播图 -->
<button id="prev">向前</button>
<button id="next">向后</button>
<button id="pause">停止</button>
<button id="start">开始</button>
<button id="jump">到第二张</button> <script src="lib/jquery/jquery.js"></script>
<script src="lib/bootstrap/js/bootstrap.js"></script>
<!-- 轮播图还支持js控制 -->
<script>
$(function(){
$('.carousel').carousel({
interval: 2000,//轮播间隔
pause:"hover", //鼠标悬停在轮播图上,是否停止滚动
wrap:true, //
keyboard:true //响应键盘事件
}); $("#prev").click(function(event) {
$('.carousel').carousel('prev')// 周期上一个项目。
}); $("#next").click(function(event) {
$('.carousel').carousel('next')// 周期到下一个项目。
});; $("#pause").click(function(event) {
$('.carousel').carousel('pause')// 从通过项目循环停止传送带。
});; $("#start").click(function(event) {
$('.carousel').carousel('cycle')// 通过传送带项目周期从左到右。
});; $("#jump").click(function(event) {
$('.carousel').carousel(1)// 循环传送带到一个特定的帧(0为主,类似于数组)。
});; });
</script>
</body>
</html>

注意引入.css和.js 文件查看效果(里面有三张图片,随便找几张代替便可)

Bootstrap 轮播图的使用和理解的更多相关文章

  1. Bootstrap 我的学习记录4 轮播图的使用和理解

    <!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="utf-8& ...

  2. bootstrap轮播图 两侧半透明阴影

    用bootstrap轮播图:Carousel插件,图片两侧影音实在碍眼,想去掉,首先发现有css里由opacity: 0.5这个东西来控制,全部改成opacity: 0.0,发现指示箭头也看不见了. ...

  3. bootstrap轮播图--兼容IE7

    <!DOCTYPE html> <html> <head> <title>Bootstrap轮播</title> <meta char ...

  4. 动态请求数据并放入bootstrap轮播图

    下面是前端代码: <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> < ...

  5. 第124天:移动web端-Bootstrap轮播图插件使用

    Bootstrap JS插件使用 > 对于Bootstrap的JS插件,我们只需要将文档实例中的代码粘到我们自己的代码中> 然后作出相应的样式调整 Bootstrap中轮播图插件叫作Car ...

  6. bootstrap轮播图组件

    一.轮播图组件模板(官方文档) <div id="carousel-example-generic" class="carousel slide" dat ...

  7. bootstrap轮播图

    <!doctype html><html><head> <meta charset="utf-8"> <title>使用 ...

  8. Bootstrap 轮播图(Carousel)插件

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  9. bootstrap轮播图不能显示左右箭头

    引入font文件夹即可 原文 :http://www.imooc.com/qadetail/64277

随机推荐

  1. 北京Uber优步司机奖励政策(3月8日)

    滴快车单单2.5倍,注册地址:http://www.udache.com/ 如何注册Uber司机(全国版最新最详细注册流程)/月入2万/不用抢单:http://www.cnblogs.com/mfry ...

  2. NB-IOT移植移动onenet基础通信套件之Object_ID,实例ID,资源ID

    1. 访问是按照分层的,Object_ID/实例ID/资源ID,对应每一层ID的数据类型,目前是分为3层,一个实例下面可以有多个实例id,对下面的数据结构来说,如果是资源ID的话,类型只能是asBuf ...

  3. Process Monitor工具找网吧广告

    很多网吧经常有遇到有一些客户机多了一些广告或者是可能是有中毒的情况.Process Monitor 软件可以方便的监视和记录系统各程序的进程线程,注册表,网络,文件读写等活动. 1,开超级用户,双击打 ...

  4. GitLab 自动触发 Jenkins 构建

    GitLab 是当前应用非常广泛的 Git Hosting 工具,Jenkins 是非常牛逼的持续集成工具.尽管 GitLab 有内建的 GitLab CI,但它远没有 Jenkins 那么强大好用. ...

  5. HIS系统两种收费模式比较:前计费和后计费

    一.药品 a.前计费:审核(临时医嘱)或者分解(长期医嘱)计费 退费处理方式,1)如果是还未发药,则护士站直接退费;2)如果药房已经发药,则护士站发出退费申请,由护士拿着药品去药房退药退费. b.后计 ...

  6. c的多态

    使用函数数组,实现多态 参考my_strtoll10

  7. 项目实战:BBS+Blog项目开发

    01-博客系统之功能需求 02-博客系统之表结构设计1 03-博客系统之表结构设计2 04-博客系统之表结构设计3 05-博客系统之表结构设计4 06-博客系统之表机构设计5 07-博客系统之创建系统 ...

  8. 关于Python 中的 if 语句

    学习Python,最开始我们都是先从函数学起,Python教程中有很多函数,if算是其中之一. 可能最为人所熟知的编程语句就是 if 语句了.例如: >>> >>> ...

  9. 几个常见移动平台浏览器的User-Agent

    之前介绍的手机站跳转url的一片文稿中提到,依据User Agent判断终端的方法.(文章地址:http://www.cnblogs.com/dereksunok/p/3664169.html ) 若 ...

  10. 棋盘问题:dfs

    Description 在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别.要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子 ...