simpleParallax.jsデモページ

js

              
document.addEventListener("DOMContentLoaded", function () {

const elem = document.querySelector(".js-target-parallax");
  if (elem !== null) { //クラス名js-target-parallaxがあるか判定
    let target = document.getElementsByClassName("js-target-parallax"); //クラス名js-target-parallaxがある要素をすべて取得

    let parallaxConfig = { //simpleParallaxの設定
        delay: 0,
        orientation: "down",
        scale: 1.5

    };

    const parallax_instance = new simpleParallax(target, parallaxConfig);

    }
  });