网页特效栏目收集了最全最新的前端网页插件,包括最流行的jQuery,Bootstrap,Js,Css,Vue等主流特效插件。
Swiper是一款轻量级jQuery滑块插件(无需css样式),用于创建图像旋转或幻灯片播放展示特效,具有自动播放、动态加载图像、导航/分页控件等功能。
使用方法:
1. 在html页面中加载jquery库和swiper插件文件
<script src="jquery.min.js"></script>
<script src="swiper.js"></script>
2.创建一个空元素作为滑块的容器。
<div class="mySlider"></div>
3.在数组中定义图像的路径。
const imageList = ['1.jpg', '2.jpg', '3.jpg']
4.初始化插件。
$('.mySlider').swiper({
imageList: imageList
animateType: 'animate'
});
5.将插件初始化为交叉淡入幻灯片播放效果。
$('.mySlider').swiper({
imageList: imageList
animateType: 'fade'
});
6.禁用自动播放功能。
$('.mySlider').swiper({
imageList: imageList
isAuto: true
});
7.启用或禁用导航/分页控件。
$('.mySlider').swiper({
imageList: imageList
changeBtn: true,
slideBtn: true
});
8.指定渲染图像的宽度。
$('.mySlider').swiper({
imageList: imageList
imageWidth: 400
});
转载请注明来源:jquery图片滚动轮播特效插件(无需css样式)
本文永久链接地址:https://www.moyouyouw.cn/code/716.html
郑重声明:本站所有主题/文章除标明原创外,均来自网络转载,版权归原作者所有,如果有侵犯到您的权益,请联系本站删除,谢谢!我们不承担任何技术及版权问题,且不对任何资源负法律责任。
已有 位小伙伴发表了看法
欢迎 你 发表评论