diff --git a/src/parallax.js b/src/parallax.js index 3c345b3..c63c4be 100644 --- a/src/parallax.js +++ b/src/parallax.js @@ -149,7 +149,8 @@ const MAGIC_NUMBER = 30, pointerEvents: false, precision: 1, onReady: null, - selector: null + selector: null, + useInlinePosition: true } class Parallax { @@ -302,10 +303,12 @@ class Parallax { helpers.accelerate(layer) } - layer.style.position = index ? 'absolute' : 'relative' - layer.style.display = 'block' - layer.style.left = 0 - layer.style.top = 0 + if (this.useInlinePosition) { + layer.style.position = index ? 'absolute' : 'relative' + layer.style.display = 'block' + layer.style.left = 0 + layer.style.top = 0 + } let depth = helpers.data(layer, 'depth') || 0 this.depthsX.push(helpers.data(layer, 'depth-x') || depth)