Bootstrap学习之Carousel_bootstrap carousel__panda_的博客-程序员秘密

技术标签: 插件  HTML  bootstrap  webstrom  jquery  

Carousel carousel.js

这是bootstrap的一个js插件,使用的时候需要引入bootstrap的库,而bootstrap的是在jQuery的基础下运行的。

<script src="js/jquery-2.1.4.min.js"></script>
<script src="js/bootstrap.min.js"></script>

A slideshow component for cycling through elements, like a carousel. Nested carousels are not supported.

这是一个滑动栏。

这是一些关键词

1: Initial active element required:The .active class needs to be added to one of the slides. Otherwise, the carousel will not be visible.

class="active"
active类是默认被选中第一个展示


2:

<div class="item">
  <img src="..." alt="...">
  <div class="carousel-caption">
    <h3>...</h3>
    <p>...</p>
  </div>
</div>

每个item类可以加以阐述

3:可以改变延迟扩展的时间




4:或者我们用js来实现


.carousel(options)

Initializes the carousel with an optional options object and starts cycling through items.

复制
$('.carousel').carousel({
     
  interval: 2000
})

5:效果图


以下是具体代码实现


<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.2/css/bootstrap.css">
    <title></title>
    <style>
        #carousel-example-generic{
            width: 800px;
            height: auto;
            margin-left: auto;
            margin-right: auto;
            margin-top: 60px;
            margin-bottom: 80px;

        }
    </style>
</head>
<body>
<div id="carousel-example-generic" style="text-align: center" class="carousel slide"  data-ride="carousel" data-interval="3000" >
    <!-- 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>
        <li data-target="#carousel-example-generic" data-slide-to="3"></li>
        <li data-target="#carousel-example-generic" data-slide-to="4"></li>
        <li data-target="#carousel-example-generic" data-slide-to="5"></li>
        <li data-target="#carousel-example-generic" data-slide-to="6"></li>
    </ol>

    <!-- Wrapper for slides -->
    <div class="carousel-inner" role="listbox">
        <div class="item active">
            <img src="images/manchester_city1.jpg" alt="...">
                <div class="carousel-caption">
                    <h3></h3>
                </div>
            <div class="carousel-caption">

            </div>
        </div>
        <div class="item">
            <img src="images/manchester_city2.jpg" alt="...">

            <div class="carousel-caption">

            </div>
        </div>
        <div class="item">
            <img src="images/manchester_city3.jpg" alt="...">

            <div class="carousel-caption">

            </div>
        </div>
        <div class="item">
            <img src="images/manchester_city4.jpg" alt="...">

            <div class="carousel-caption">

            </div>
        </div>
        <div class="item">
            <img src="images/manchester_city5.jpg" alt="...">

            <div class="carousel-caption">

            </div>
        </div>
        <div class="item">
            <img src="images/manchester_city6.jpg" alt="...">

            <div class="carousel-caption">

            </div>
        </div>
        <div class="item">
            <img src="images/manchester_city7.jpg" 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>
<script>
    $('.carousel').carousel({
        interval: 2000;
    })
</script>
<script src="js/jquery-2.1.4.min.js"></script>
<script src="js/bootstrap.min.js"></script>
</body>
</html>

以下是用到的图片


版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/qq_18832439/article/details/48091435

智能推荐

np.random.randint和random.randint_豪言成笑谈的博客-程序员秘密

np.random.randint(low, high=None, size=None, dtype=’l’) (return a range of intergers with low or high bounds)Return random integers from low (inclusive) to high (exclusive). the specified dtype in the “half-open” interval [low, high). Ifhigh is None (the

多旋翼飞行器设计与控制·Pixhawk4以及外部设备接线(笔记004)_手可摘星辰不去高声语的博客-程序员秘密

笔记主要来源:Pixhawk 4 接线快速入门目录一、Pixhawk 4 的各个接口二、接线图概览(重要传感器及外围设备)三、飞控、GPS的安装和方向四、电源五、无线电遥控六、数传电台(可选)七、SD Card(可选)八、电机以及其他外设一、Pixhawk 4 的各个接口FMU:Flight Management Unit 飞行管理组件主 FMU 处理器:STM32F765 32 位 Arm Cortex-M7,216MHz,2MB...

Hexo-Fluid主题添加音乐页面_hexo fuild主题添加音乐页面_林慕凡的博客-程序员秘密

效果预览:https://bynote.cn/playlist/如果你想使用音乐页面,很多人都会推荐安装hexo-tag-aplayer这款插件。 这款插件通过Hexo独有的标签外挂,我们可以很方便的写入一些参数,插件就会帮我们生成对应的html。例如 :如果使用插件,在markdown中要这样写{% meting "000PeZCQ1i4XVs" "tencent" "artist" "theme:#3F51B5" "mutex:true" "preload:auto" %}其会被渲染为&.

navicat版本低连接远程mysql报错_kareter的博客-程序员秘密

用navicat连接远程连接mysql,报错不知道原因。mysql安装在云服务器上ubantu,liunx基本不接触。。。。,安装ubantu也只是想练练linux。第一个错 Can't connect to MySQL server xxx.xxx.xxx.xxx (10061)查---说是配置文件/etc/mysql/my.cnf中bind-address = 127.0.0.1要注释掉,改了以后重启mysql(命令service mysql restart),重启后这个报错不见了,但又出现

【mysql】MYSQL的日志(redo log,binlog)顺序读写,数据文件随机读写以及linux底层原理_redo log如何保证顺序写_云川之下的博客-程序员秘密

文章目录前言1. 对于redo log,binlog这种日志进行的磁盘顺序读写2. 对于表空间磁盘文件里的数据页进行的磁盘随机读写3. Linux操作系统的存储系统4. 数据库服务器使用的RAID存储架构4.1 RAID存储架构的电池充放电原理4.2 RAID锂电池充放电导致MYSQL数据库性能抖动的优化4.3 解决RAID锂电池充放电导致的存储性能抖动的解决方案前言redo log用于恢复bufferpool,binlog用户恢复聚簇索引对应的ibd文件1. 对于redo log,binlog这种日

vue中根据输入地址生成百度地图_进阶de程序猿的博客-程序员秘密

在indexHTML中加入引用ak=? ?为百度地图密匙&lt;script type="text/javascript" src="http://api.map.baidu.com/getscript?v=2.0&amp;ak=?"&gt;&lt;/script&gt;webpack.base.conf.js中与entry同级entry: { app: './src/main....

随便推点

Nacos临时实例和持久化实例_ephemeral nacos_星夜孤帆的博客-程序员秘密

一、nacos两种健康检查模式1.1 agent上报模式客户端(注册在nacos上的其它微服务实例)健康检查。客户端通过心跳上报方式告知服务端(nacos注册中心)健康状态;默认心跳间隔5秒;nacos会在超过15秒未收到心跳后将实例设置为不健康状态;超过30秒将实例删除;1.2 服务端主动检测服务端健康检查。nacos主动探知客户端健康状态,默认间隔为20秒;健康检查失败后实例会被标记为不健康,不会被立即删除。1.3 临时实例临时实例通过agent上报模式实

SD 2.0 会议感兴趣的几个话题_Fenng的博客-程序员秘密

&amp;#13; 晚上的飞机去北京。明天参加 CSDN 组织的 SD 2.0 技术会议。会议的话题林林总总,我仔细挑选了几个。相对一些业界名人味同嚼蜡的”宏观技术”演讲,我更喜欢参加在技术一线的技术人的分享,”技术含量” 是衡量技术会议质量的唯一标准。选几个自己将参加的主题:云风 — 高性能健壮系统中的内存管理虽然和云风都在杭州,但是一直没机会见面。他的 Blog 我可是每...

dubbo钩子怎么解决_Dubbo ShutdownHook 优雅停机整理_山巅之峰的博客-程序员秘密

Dubbo优雅停机的机制Dubbo是通过JDK的ShutdownHook来完成优雅停机的所以如果用户使用 kill -9 PID 等强制关闭命令,是不会执行优雅停机的,只有通过 kill PID时,才会执行Dubbo 中实现的优雅停机机制主要包含6个步骤:(1)收到 kill PID 进程退出信号,Spring 容器会触发容器销毁事件。(2)provider 端会注销服务元数据信息(删除ZK节点)...

gorm Find查询流程源码分析_一只努力的微服务的博客-程序员秘密

gorm查询流程源码分析gorm是用golang写的数据库orm库,目前golang写的orm库也有很多,例如xorm,beego orm,gomybatis等,各有各的优势特点,看一下gorm对golang基础框架中数据库相关接口是如何封装的。gorm一般的初始化方式db, err := gorm.Open("mysql", "user:[email protected]/dbname?charset=u...

【JavaScript】freecodecamp---------Chunky Monkey_AC_greener的博客-程序员秘密

猴子吃香蕉, 分割数组(猴子吃香蕉可是掰成好几段来吃哦) 把一个数组arr按照指定的数组大小size分割成若干个数组块。 例如:chunk([1,2,3,4],2)=[[1,2],[3,4]]; chunk([1,2,3,4,5],2)=[[1,2],[3,4],[5]]; function chunk(arr, size) { // 请把你的代码写在这里 ...

IDA PRO的流程图功能_eqera的博客-程序员秘密

从4.17版开始IDA PRO就提供了流程图功能,它使用了VCG图形库里面的WinGrah32工具。IDA PRO可以提供标准的GDL图形给WinGrah32来绘制流程图。流程图工具条如下所示。 下面我们来看一些流程图工具的一些具体使用方法。流程图通过流程图来分析一个功能函数,可以清晰的看出程序的流程结构,使得分析更清楚,更容易。使用FlowChart按钮,可以绘制流程图。

推荐文章

热门文章

相关标签