我已经使用 Glide.js 实现了 2 个滑块,它们在 Chrome 和 FireFx 中运行良好。
我已经尝试在 IE11 和 Edge 中实现它,但都不会向 DOM 元素添加事件,因此滑块都不起作用。
此外,在某些宽度下,我想让超过 1 张幻灯片出现在屏幕上,而 glide 不想调整幻灯片的大小,以便它们可以按预期的方式进行调整。
我的问题是:
为什么事件不附加(绑定/添加,我不太确定在 glide js 中事件发生什么类型的操作)到 DOM 元素?
为什么样式会因为我所做的断点而变得疯狂,所以出现的幻灯片不超过 1 张?
GlideJS github 假定它在 edge 和 IE11 上都运行良好,那么我哪里错了?
代码:通过module导入,然后在webpack中通过babel编译
const tech_section_glide = new Glide('#tech_stack_section_slider', {
type: 'slider',
perView: 4,
animationDuration: 500,
gap: 10,
breakpoints: {
449: {
perView: 1
},
705: {
perView: 2,
},
1024: {
perView: 3
}
}
});
const portfolio_glide = new Glide('#portfolio_slider', {
type: 'slider',
perView: 1,
animationDuration: 300
});
tech_section_glide.mount();
portfolio_glide.mount();
这是它在 Chrome 中的外观: Chrome 视图
这是它在 IE11 中的样子:
繁星淼淼
相关分类