<!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. 十分钟部署Anemometer作为Mysql慢查询可视化系统

    前言 采用Anemometer将Mysql慢查询日志可视化,可以更便捷的查询慢查询日志,并根据时间戳进行历史查询.如下是单机版Anemometer部署的演示,实际应用中,为安全起见,建议把anemom ...

  2. 西安Uber优步司机奖励政策(12月28日到1月3日)

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

  3. 相机-imu外参校准总结

    1. 研究背景及相关工作 1)研究背景 单目视觉惯性slam是一种旨在跟踪移动平台的增量运动并使用来自单个车载摄像头和imu传感器的测量结果同时构建周围环境地图的技术.视觉相机和惯性测量单元(imu) ...

  4. 收集、分析线上日志数据实战——ELK

    本文来自网易云社区 作者:田躲躲 用户行为统计(User Behavior Statistics, UBS)一直是互联网产品中必不可少的环节,也俗称埋点.对于产品经理,运营人员来说,埋点当然是越多,覆 ...

  5. WEB框架概述(译)

    在学习WEB框架之前,我个人觉得需要搞清楚一件事:什么是WEB框架?在网上找了很多资料,觉得什么是WEB框架这篇文章讲的比较全面而清晰,本文作者Jeff Knupp. 全文如下: Web 应用框架,或 ...

  6. HTML5项目笔记10:使用HTML5 IndexDB设计离线数据库

    之前的文章(http://www.cnblogs.com/wzh2010/archive/2012/05/22/2514017.html)里面描述了HTML5 离线数据存储的Web SQL,一个基于S ...

  7. hdu2094产生冠军(思维题)

    产生冠军 Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submis ...

  8. PHP使用Redis消息队列

    1.redis安装 参考:菜鸟教程http://www.runoob.com/redis/redis-install.html 2.安装php的redis扩展 1)phpinfo()查看php版本信息 ...

  9. python爬虫基础之一(爬淘宝)

    没想到python如此强大, 今天看一会视频学会了一段python爬虫 这就是我今天学到的内容爬去淘宝网关于书包的一些信息,包括价格, #coding=utf-8 import requests#导入 ...

  10. JS的六大对象:Global、Math、Number、Date、JSON、console,运行在服务器上方的支持情况分析

    在ASP中使用runat="server"来调用JS的相关函数,代码如下: <script runat="server" language="j ...