diff --git a/demos/native-horizontal/custom.js b/demos/native-horizontal/custom.js index aaa1681..87bf069 100644 --- a/demos/native-horizontal/custom.js +++ b/demos/native-horizontal/custom.js @@ -43,7 +43,7 @@ class Parallax extends Smooth { this.cache.push(bounds) }) this.dom.section.style.width = `${this.vars.width}px` - this.vars.bounding = (unit * this.dom.divs.length) + this.vars.bounding = (unit * (this.dom.divs.length - 3)) + this.vars.height } run() { @@ -61,7 +61,7 @@ class Parallax extends Smooth { const inview = right > 0 && left < this.vars.width if(inview) { if(!el.state) { - el.innerHTML = 'in viewport' + el.innerHTML = `${index - 1} in viewport` el.state = true } } else { @@ -71,4 +71,4 @@ class Parallax extends Smooth { } } -export default Parallax \ No newline at end of file +export default Parallax