Merge remote-tracking branch 'origin/main'

This commit is contained in:
SDE
2023-12-22 10:27:54 +05:00

View File

@@ -224,7 +224,15 @@ function autoPlaySlider () {
if (dataset){
let index_this_slide = dataset['indexSlide']
let list_lenght = dataset['lenghtSlides']
new_slide = change_slide(index_this_slide,'next',list_lenght,'new_slide_inf')
if (parseInt(list_lenght) > 1){
new_slide = change_slide(index_this_slide,'next',list_lenght,'new_slide_inf')
} else {
if (autoplayInterval){
clearInterval(autoplayInterval)
autoplayInterval = null
showOneSlide(index_this_slide)
}
}
}
},2000)
} else {
@@ -233,9 +241,17 @@ function autoPlaySlider () {
}
}
function showOneSlide (index_this_slide) {
let slide = document.querySelector(`[data-id-slide="${index_this_slide}"]`)
slide.classList.add("show")
slide.classList.remove("hidden")
}
function resetSlider () {
clearInterval(autoplayInterval)
autoplayInterval = null
if (autoplayInterval){
clearInterval(autoplayInterval)
autoplayInterval = null
}
}
// function stopAutoPlaySlider () {