javascript - 在进度条上反映幻灯片过渡的进度
问题描述
进度条的过渡swiperjs
:https ://swiperjs.com直到它更改到另一张幻灯片才反映实际进度。
我希望它像 Facebook 和 Instagram 故事一样在自动播放中显示:
我尝试通过添加watchSlidesProgress: true,
文档中指出的参数,但没有监听事件。
关于如何做的任何帮助?
这是示例网站:http: //z-testing.000webhostapp.com/progressbar-animation/
这是我的代码:
$(document).ready(function(){
var swiperH = new Swiper('.swiper-container-h', {
paginationClickable: true,
nested: true,
watchSlidesProgress: true,
autoplay: {
delay: 2500,
disableOnInteraction: false,
},
speed: 500,
simulateTouch: false,
pagination: {
el: ".swiper-pagination",
type: "progressbar"
},
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
},
});
var swiperV = new Swiper('.swiper-container-v', {
direction: 'vertical',
slidesPerView: 'auto',
nested: true,
freeMode: true,
mousewheel: true,
pagination: {
el: '.swiper-pagination-v',
clickable: true,
},
});
});
解决方案
推荐阅读
- javascript - 验证数组中的值是否相同或不同
- sql - 如何使用 postgresql 获取 json 对象作为列值?
- mysql - 是否可以绕过 MySQL Azure 的限制?
- java - 如何查看从未来对象执行的线程(名称)
- google-cloud-platform - 检查 Google Cloud API 和服务错误日志
- python - 什么 Cygwin 包允许我调试 Python 代码?
- javascript - 在没有ajax的情况下获取并发送一个Json文件(拖放)到服务器
- c++ - 使用 ReadTheOrg 将文字程序导出为 HTML 时保留源代码块的内容
- jquery - ajax调用后如何从MVC模型重新加载数据表
- r - /usr/bin/shiny-server.sh:在 Ubuntu 上运行 R 闪亮的 docker 时权限被拒绝