如何修复 magento2 中的 Owl 轮播问题
How to fix Owl carousel problem in magento2
请查看本网站的第一个横幅“https://magento-261664-864122.cloudwaysapps.com/”,Owl 只有在我点击横幅图片时才有效
完全加载页面后的网站看起来像这样1
当点击横幅网站时看起来像这样 2
请参考Owl随意的说法
https://owlcarousel2.github.io/OwlCarousel2/docs/api-options.html
autoplay:true
<script>
(function () {
require(["jquery","owlcarousel"],function($) {
$(document).ready(function() {
$("#owlslider").owlCarousel({
navigation : true, // Show next and prev buttons
autoPlay: true, //Set AutoPlay to 3 seconds
items : 1
});
});
});
})();
</script>
请查看本网站的第一个横幅“https://magento-261664-864122.cloudwaysapps.com/”,Owl 只有在我点击横幅图片时才有效
完全加载页面后的网站看起来像这样1 当点击横幅网站时看起来像这样 2
请参考Owl随意的说法 https://owlcarousel2.github.io/OwlCarousel2/docs/api-options.html autoplay:true
<script>
(function () {
require(["jquery","owlcarousel"],function($) {
$(document).ready(function() {
$("#owlslider").owlCarousel({
navigation : true, // Show next and prev buttons
autoPlay: true, //Set AutoPlay to 3 seconds
items : 1
});
});
});
})();
</script>