关于JS,我是一个菜鸟,但我完全按照自己的意愿设置了粒子库(https://vincentgarreau.com/particles.js/),甚至还可以让JS在div中运行(例如Codepen),但我需要让它作为Squarespace模板的背景运行。
https://sprout-heptagon-wjyy.squarespace.com/
Password: 1
Uncaught TypeError: Cannot read property 'getElementsByClassName' of null
at window.particlesJS (particles.min.js:9)
at static1.squarespace.com/static/5d6ea3d4fa28060001ad957c/t/5d70439e59850f00013c7f6c/1567638430154/particle.js:7
我尝试了几件事:
particles-js
,但这破坏了正方形模板Codepen:https://codepen.io/Tollo/pen/YzKEqGm
我想让JS作为静态背景运行(最好使用Parallax滚动),以便用户始终可以看到动画。