MCPcopy Create free account
hub / github.com/electerious/basicSlider / setSlide

Function setSlide

src/scripts/main.js:158–165  ·  view source on GitHub ↗
(dotElems, slidesElem, index, length)

Source from the content-addressed store, hash-verified

156}
157
158const setSlide = function(dotElems, slidesElem, index, length) {
159
160 slidesElem.style.transform = `translateX(-${ (100 / length) * index }%)`
161
162 dotElems.forEach((dotElem) => dotElem.classList.remove('active'))
163 dotElems[index].classList.add('active')
164
165}
166
167const init = function(elem, slides, instance, opts) {
168

Callers 2

initFunction · 0.85
_gotoFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected