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){ if (dataset){
let index_this_slide = dataset['indexSlide'] let index_this_slide = dataset['indexSlide']
let list_lenght = dataset['lenghtSlides'] let list_lenght = dataset['lenghtSlides']
if (parseInt(list_lenght) > 1){
new_slide = change_slide(index_this_slide,'next',list_lenght,'new_slide_inf') 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) },2000)
} else { } else {
@@ -233,10 +241,18 @@ 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 () { function resetSlider () {
if (autoplayInterval){
clearInterval(autoplayInterval) clearInterval(autoplayInterval)
autoplayInterval = null autoplayInterval = null
} }
}
// function stopAutoPlaySlider () { // function stopAutoPlaySlider () {
// if (autoplayInterval){ // if (autoplayInterval){