Skip to content

Commit af75eb3

Browse files
authored
Update arx_slider[withoutCaption].js
1 parent 6764d21 commit af75eb3

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

arx_slider[withoutCaption].js

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,14 @@ const imgHolder = slider.querySelector(".imgholder")
1010
let currentSlider = 0;
1111
let dotsnum = sliderCount + 1;
1212
// CreateDots function creates clickable dots based on the number of images
13-
function CreateDots () {
14-
if ( dotsnum != 0 ) {
15-
const realId = sliderCount-(dotsnum-1)
16-
const newDot = document.createElement("div");
17-
newDot.classList.add("slider_dots");
18-
newDot.setAttribute("id", realId);
19-
newDot.setAttribute("onclick", ("sliderJump" + "(" + realId + ")") )
20-
slider_dots_holder.appendChild(newDot);
21-
dotsnum--;
22-
CreateDots()
23-
}
13+
for ( ;dotsnum != 0;dotsnum--) {
14+
const realId = sliderCount-(dotsnum-1)
15+
const newDot = document.createElement("div");
16+
newDot.classList.add("slider_dots");
17+
newDot.setAttribute("id", realId);
18+
newDot.setAttribute("onclick", ("sliderJump" + "(" + realId + ")") )
19+
slider_dots_holder.appendChild(newDot);
2420
}
25-
CreateDots()
2621
// Below codes are for Next and previous butttons
2722
const sliderdots = slider.querySelectorAll(".slider_dots")
2823

0 commit comments

Comments
 (0)