导航:首页 > 编程语言 > carouseljs自动轮播

carouseljs自动轮播

发布时间:2023-08-05 20:42:20

1. Bootstrap如何实现触屏左右滑动轮播

我自己写的BS轮播加手势滑动,引入了一个插件,直接看代码吧:


js">//引入插件
<linkhref="css/bootstrap.min.css"rel="stylesheet">
<scriptsrc="js/jquery.min.js"></script>
<scriptsrc="js/bootstrap.min.js"></script>
<scriptsrc="js/jgestures.min.js"></script>

JS代码:

<script>
$(document).ready(function(){
//手势右滑回到上一个画面
$('#myCarousel').bind('',function(){
$("#myCarousel").carousel('prev');
})
//手势左滑进入下一个画面
$('#myCarousel').bind('',function(){
$("#myCarousel").carousel('next');
})
})
</script>

HTML代码:

<divid="myCarousel"class="carouselslidepad_010b_k"data-ride="carousel">
<!--轮播(Carousel)指标-->
<olclass="carousel-indicators">
<lidata-target="#myCarousel"data-slide-to="0"class="active"></li>
<lidata-target="#myCarousel"data-slide-to="1"></li>
<lidata-target="#myCarousel"data-slide-to="2"></li>
</ol>
<!--轮播(Carousel)项目-->
<divclass="carousel-innerbor_btm">
<divclass="itemactive">
<divclass="rowmarg_0pad_t_10">
<divclass="col-xs-3nav_tag_ico">
<imgsrc="images/yule.png"width="70%">
<pclass="nav_tag_t">娱乐</p>
</div>
<divclass="col-xs-3nav_tag_ico">
<imgsrc="images/huodong.png"width="70%">
<pclass="nav_tag_t">活动</p>
</div>
<divclass="col-xs-3nav_tag_ico">
<imgsrc="images/tuangou.png"width="70%">
<pclass="nav_tag_t">团购</p>
</div>
<divclass="col-xs-3nav_tag_ico">
<imgsrc="images/huiyuanka.png"width="70%">
<pclass="nav_tag_t">会员卡</p>
</div>
<divclass="col-xs-3nav_tag_ico">
<imgsrc="images/meishi.png"width="70%">
<pclass="nav_tag_t">美食</p>
</div>
<divclass="col-xs-3nav_tag_ico">
<imgsrc="images/dianying.png"width="70%">
<pclass="nav_tag_t">电影</p>
</div>
<divclass="col-xs-3nav_tag_ico">
<imgsrc="images/jiudian.png"width="70%">
<pclass="nav_tag_t">酒店</p>
</div>
<divclass="col-xs-3nav_tag_ico">
<imgsrc="images/waimai.png"width="70%">
<pclass="nav_tag_t">外卖</p>
</div>
</div>
</div>
<divclass="item">
<divclass="rowmarg_0pad_t_10">
<divclass="col-xs-3nav_tag_ico">
<imgsrc="images/qinzi.png"width="70%">
<pclass="nav_tag_t">亲子</p>
</div>
<divclass="col-xs-3nav_tag_ico">
<imgsrc="images/zuliao.png"width="70%">
<pclass="nav_tag_t">足疗按摩</p>
</div>
<divclass="col-xs-3nav_tag_ico">
<imgsrc="images/jingdian.png"width="70%">
<pclass="nav_tag_t">景点</p>
</div>
<divclass="col-xs-3nav_tag_ico">
<imgsrc="images/jia.png"width="70%">
<pclass="nav_tag_t">到家</p>
</div>
<divclass="col-xs-3nav_tag_ico">
<imgsrc="images/yundong.png"width="70%">
<pclass="nav_tag_t">运动健身</p>
</div>
<divclass="col-xs-3nav_tag_ico">
<imgsrc="images/gouwu.png"width="70%">
<pclass="nav_tag_t">购物</p>
</div>
<divclass="col-xs-3nav_tag_ico">
<imgsrc="images/KTV.png"width="70%">
<pclass="nav_tag_t">KTV</p>
</div>
<divclass="col-xs-3nav_tag_ico">
<imgsrc="images/jiehun.png"width="70%">
<pclass="nav_tag_t">结婚</p>
</div>
</div>
</div>
<divclass="item">
<divclass="rowmarg_0pad_t_10">
<divclass="col-xs-3nav_tag_ico">
<imgsrc="images/chongwu.png"width="70%">
<pclass="nav_tag_t">宠物</p>
</div>
<divclass="col-xs-3nav_tag_ico">
<imgsrc="images/aiche.png"width="70%">
<pclass="nav_tag_t">爱车</p>
</div>
<divclass="col-xs-3nav_tag_ico">
<imgsrc="images/youhui_002.png"width="70%">
<pclass="nav_tag_t">优惠</p>
</div>
<divclass="col-xs-3nav_tag_ico">
<imgsrc="images/yanchu.png"width="70%">
<pclass="nav_tag_t">演出</p>
</div>
<divclass="col-xs-3nav_tag_ico">
<imgsrc="images/kafei.png"width="70%">
<pclass="nav_tag_t">咖啡厅</p>
</div>
<divclass="col-xs-3nav_tag_ico">
<imgsrc="images/jiaoyu.png"width="70%">
<pclass="nav_tag_t">教育培训</p>
</div>
<divclass="col-xs-3nav_tag_ico">
<imgsrc="images/jiazhuang.png"width="70%">
<pclass="nav_tag_t">家装</p>
</div>
<divclass="col-xs-3nav_tag_ico">
<imgsrc="images/qita.png"width="70%">
<pclass="nav_tag_t">全部分类</p>
</div>
</div>
</div>
</div>
</div>

CSS代码就自己写吧,相信难不倒你

阅读全文

与carouseljs自动轮播相关的资料

热点内容
微信打码赚钱安卓软件 浏览:608
苹果官换机买什么版本 浏览:979
visio数据模型怎么用 浏览:179
关于驾驶的app 浏览:92
多线程编程有什么特点 浏览:453
iso文件系统 浏览:116
苹果932拦截骚扰电话 浏览:765
盲盒开箱app有哪些 浏览:422
win10激活脚本之家 浏览:191
魔鬼作坊工具包 浏览:185
ae源文件下载 浏览:520
如何将照片内容转换成pdf文件 浏览:137
浙里办app如何更换手机号码 浏览:244
电子资料文件有哪些 浏览:241
猥琐猫表情教程 浏览:599
android音频文件格式 浏览:458
漫画脸app哪里可以下载 浏览:959
购买欢乐升级欢乐豆 浏览:282
学习智能机器人用什么编程最好 浏览:655
苹果手机如何管控app 浏览:633

友情链接