广告合作
  • 今日头条

    今日头条

  • 百度一下

    百度一下,你就知道

  • 新浪网

    新浪网 - 提供新闻线索,重大新闻爆料

  • 搜狐

    搜狐

  • 豆瓣

    豆瓣

  • 百度贴吧

    百度贴吧——全球领先的中文社区

  • 首页 尚未审核订阅工具 订阅

    bootstrap怎么修改轮播速度

    来源:网络收集  点击:  时间:2024-08-22
    【导读】:
    bootstrap怎么修改轮播速度工具/原料morebootstrap方法/步骤1/8分步阅读

    打开vs2017

    2/8

    为了快速的搭建一个bootstrap环境

    我们新建一个MVC的工程

    3/8

    选择MVC

    生成的项目中,已经包含bootstrap了

    4/8

    轮播时bootstrap的carousel 插件

    我们将home index改造一下,先添加一个轮播

    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 style=height:150px;background-color:black

    div class=carousel-caption

    轮播1

    /div

    /div

    div class=item style=height:150px; background-color:black

    div class=carousel-caption

    轮播2

    /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-onlyPrevious/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-onlyNext/span

    /a

    /div

    5/8

    运行起来就能看到轮播的效果

    6/8

    这是一个最基本的轮播

    要想控制轮播的速度需要写js来进行控制

    7/8

    控制轮播的速度是一个可设定的属性

    interval 单位是毫秒

    填入控制代码

    $(.carousel).carousel({

    interval: 2000

    })

    8/8

    修改完成后,在运行画面

    就可以看到轮播的间隔已经变了

    BOOTSTRAPCAROUSEL
    本文关键词:

    版权声明:

    1、本文系转载,版权归原作者所有,旨在传递信息,不代表看本站的观点和立场。

    2、本站仅提供信息发布平台,不承担相关法律责任。

    3、若侵犯您的版权或隐私,请联系本站管理员删除。

    4、文章链接:http://www.1haoku.cn/art_1149481.html

    相关资讯

    ©2019-2020 http://www.1haoku.cn/ 国ICP备20009186号05-07 06:54:10  耗时:0.030
    0.0298s