基于Bootstrap支持移动端的响应式轮播图效果

插件介绍
bootstrap-carousel-touch-slider是一款基于Bootstrap支持移动端的响应式轮播图效果。该轮播图特效可以使用手指进行滑动切换。并且它和animate.css结合,可以制作出各种炫酷的文字动画效果。

使用方法
在页面中引入bootstrap相关文件,font-awesome.css字体图标文件,animate.min.css动画文件,以及jquery.touchSwipe.min.js文件。
<link href=”path/to/bootstrap.min.css” rel=”stylesheet”>
<link href=”path/to/font-awesome.min.css” rel=”stylesheet”>
<link href=”path/to/animate.min.css” rel=”stylesheet”>
<script src=”path/to/jquery.min.js”></script>
<script src=”path/to/bootstrap.min.js”></script>
<script src=”path/to/jquery.touchSwipe.min.js”></script>

HTML结构
该轮播图采用标准的Bootstrap Carousel作为HTML结构。一个基本的Bootstrap Carousel的HTML结构如下:
<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=”…” alt=”…”>
<div class=”carousel-caption”>

</div>
</div>
<div class=”item”>
<img src=”…” 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”></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”></span>
<span class=”sr-only”>Next</span>
</a>
</div>

修改之后,最外层的包裹div元素的class类如下:
<div id=”bootstrap-touch-slider”
class=”carousel bs-slider fade  control-round indicators-line”
data-ride=”carousel”
data-pause=”hover”
data-interval=”5000″ >
……
</div>

此时,轮播图的切换方式为淡入淡出方式。如果你项使用滑动切换方式,可以将fade改为slide。
另外,有几个class类用于控制文本的对齐方式,它们是:slide_style_center, slide_style_left, slide_style_right。
最后,文本的动画都是基于animate.css的,你可以自己进行配置。

初始化插件
在页面DOM元素加载完毕之后,可以通过bsTouchSlider()方法来初始化该轮播图。
$(‘#bootstrap-touch-slider’).bsTouchSlider();

bootstrap-carousel-touch-slider轮播图的github地址为:https://github.com/bootstrapthemesco/bootstrap-carousel-touch-slider

在线预览 网盘下载

网盘下载密码:yjpi

郑重声明:

1 本资源来源于互联网,资源的版权归资源原作者所持有,受《中华人民共和国著作权法》等相关法律保护。

2 由于无法和原作者取得联系,所以上传的部分资源无法先通过原作者的同意就分享给大家了,如本资源侵犯了您(原作者)的权益,请联系我们(微信号 xiaohaimei1989),我们会立马删除您的资源,并向您表达诚挚的歉意!

3 本站是一个公益型网站,分享资源的目的在于传播知识,分享知识,收取一点点打赏的辛苦费是用于网站的日常运营开支,并非用于商业用途。

4 本站资源只提供学习和参考研究使用,使用过后请在第一时间内删除。本站不承担资源被单位或个人商用带来的法律责任。

发表评论