MCPcopy Create free account
hub / github.com/codrops/ShapesSlideshow / Navigation

Class Navigation

src/js/navigation.js:1–15  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1export class Navigation {
2 constructor(el) {
3 this.DOM = {el};
4 this.DOM.ctrls = {
5 next: this.DOM.el.querySelector('.slides-nav__button--next'),
6 prev: this.DOM.el.querySelector('.slides-nav__button--prev')
7 };
8 this.DOM.current = this.DOM.el.querySelector('.slides-nav__index-current');
9 this.DOM.total = this.DOM.el.querySelector('.slides-nav__index-total');
10 }
11 // updates the current value
12 updateCurrent(position) {
13 this.DOM.current.innerHTML = position < 10 ? `0${position+1}` : position;
14 }
15}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected