fix: Meetup slide problem

Signed-off-by: TheYoungManLi <cjl@kubesphere.io>
This commit is contained in:
TheYoungManLi 2022-03-16 10:34:01 +08:00
parent e2bd653466
commit 9b66c0c125

View File

@ -241,6 +241,7 @@
current: null,
create: function () {
const documentWidth = $(document).width()
const childNum = $('#swiper-wrapper').children().length
const option = {
autoplay: {
running: true,
@ -249,11 +250,12 @@
},
delay: autoplayTime,
speed: 500,
loop: true,
loop: childNum > 3 ? true : false,
}
if (documentWidth > 800) {
option.slidesPerView = 3
option.spaceBetween = 20
hideSlideButton(childNum <= 3)
}
if (documentWidth < 800) {
@ -310,6 +312,16 @@
})
}
var hideSlideButton = function (hide) {
if (hide) {
$('.prev-button').hide()
$('.next-button').hide()
} else {
$('.prev-button').show()
$('.next-button').show()
}
}
bindClickVideoTabLi()
bindClickVideoLi()
initVideos()