Bootstrap 实现图片翻滚
今天给大家带来的是Bootstrap 实现的图片翻滚 效果图如下

点击左右箭头可以实现向左向右转动,这个功能在Bootstrap 官网和菜鸟教程上都有讲解,有点bootstrap基础的都能看明白 ,这里我就说一下容易忽视的地方,
1.在实现这个功能前需要加载 一下两个文件:
<script src="../js/jquery.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
2. 如果Bootstrap自带的效果不能满足要求需要修改JS文件 那么就需要修改一下文件,按照需求修改样式即可
<link href="../js/css/bootstrap.css" rel="stylesheet">
贴一下我自己写的代码:样式是修改过的了。
<div id="carousel-example-generic" class="carousel" data-ride="carousel">
<!-- Wrapper for slides -->
<div class="carousel-inner">
<div class="item active col-md-10 col-lg-offset-1" >
<img src="../img/beiing.jpg" alt="..." class="img-rounded col-md-2">
<img src="../img/shanghai.jpg" alt="..." class="img-rounded col-md-2">
<img src="../img/chaoyang.jpg" alt="..." class="img-rounded col-md-2">
<img src="../img/guangzhou.jpg" alt="..." class="img-rounded col-md-2">
<img src="../img/dalian.jpg" alt="..." class="img-rounded col-md-2">
<img src="../img/shenyang.jpg" alt="..." class="img-rounded col-md-2">
</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>
<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>
</div>
希望能够帮到大家,如果有什么需要可以留言!
Bootstrap 实现图片翻滚的更多相关文章
- 利用bootstrap写图片轮播
利用bootstrap写图片轮播 缺点是轮播没有固定样式图片样式会改变外框的大小,所以要再设置 以及左右按钮的style也要从新设置 <div class="carousel slid ...
- jq实现鼠标经过图片翻滚效果
短短的十多行代码就实现了一个酷炫的图片翻滚代码,要实现这个效果并不难,只要思路对了,一切都好办,不多说了,直接上代码看效果! html结构: <ul class="list" ...
- 基于bootstrap的图片轮播效果展示
<!DOCTYPE html><html lang="zh-CN"> <head> <meta charset="utf-8&q ...
- Bootstrap之图片展示界面Demo2
代码:(使用模板引擎freemarker) <!DOCTYPE html> <html> <head> <title>图片</title> ...
- Bootstrap之图片展示界面Demo
代码:(使用模板引擎freemarker) <!DOCTYPE html> <html> <head> <title>图片</title> ...
- 利用bootstrap实现图片Carousel效果
引入头文件: <link rel="stylesheet" href="bootstrap.min.css"> <link rel=" ...
- ⑦bootstrap按钮 图片 辅助使用基础案例
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- bootstrap -- css -- 图片
图片样式 .img-rounded:添加 border-radius:6px 来获得图片圆角 .img-circle:添加 border-radius:500px 来让整个图片变成圆形. img-ci ...
- BootStrap实现图片轮播
<div class="container"> <div data-ride="carousel" id="carou ...
随机推荐
- 引用类型之Array(一)
Array类型 除了Object之外,Array类型在ECMAScript中也很常用.ECMAScript中的数组与其他多数语言中的数组有着相当大的区别.ECMAScript数组的每一项可以保存任何类 ...
- windows上启动docker容器报错:standard_init_linux.go:211: exec user process caused “no such file or directory” - Docker
解决方案: standard_init_linux.go:190: exec user process caused "no such file or directory" - D ...
- 两个多维高斯分布之间的KL散度推导
在深度学习中,我们通常对模型进行抽样并计算与真实样本之间的损失,来估计模型分布与真实分布之间的差异.并且损失可以定义得很简单,比如二范数即可.但是对于已知参数的两个确定分布之间的差异,我们就要通过推导 ...
- .NET Core使用FluentEmail发送邮件
前言 在实际的项目开发中,我们会遇到许多需要通过程序发送邮件的场景,比如异常报警.消息.进度通知等等.一般情况下我们使用原生的SmtpClient类库居多,它能满足我们绝大多数场景.但是使用起来不够简 ...
- Javascript判断数据类型的五种方式及其特殊性
Javascript判断数据类型的五种方式及区别 @ 目录 typeof instanceof Object.prototype.toString isArray iisNaN ----------- ...
- rabbitmq 交换机模式一 直连模式 direct
代码 <?php require_once "./vendor/autoload.php"; use PhpAmqpLib\Connection\AMQPStreamConn ...
- intellij idea:设置java方法注释模板(intellij idea 2019.2)
一,打开方法注释模板的编辑窗口 菜单file->打开settings editor栏目下->打开Live Templates 说明:刘宏缔的架构森林是一个专注架构的博客,地址:http ...
- Go go.mod入门
什么是go.mod? Go.mod是Golang1.11版本新引入的官方包管理工具用于解决之前没有地方记录依赖包具体版本的问题,方便依赖包的管理. Go.mod其实就是一个Modules,关于Modu ...
- matplotlib 饼状图
import matplotlib.pyplot as plt import matplotlib as mpl # 支持中文 plt.rcParams['font.sans-serif'] = [' ...
- STM32时钟和定时器
时钟源 STM32包含了5个时钟源,分别为HSI.HSE.LSI.LSE.PLL. HSI是高速内部时钟.RC振荡器,频率为8MHz: HSE是高速外部时钟,即晶振,可接石英/陶瓷谐振器或接外部时钟源 ...