📜  交叉点观察者 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:49.403000             🧑  作者: Mango

代码示例1
const numSteps = 20.0;

let boxElement;
let prevRatio = 0.0;
let increasingColor = "rgba(40, 40, 190, ratio)";
let decreasingColor = "rgba(190, 40, 40, ratio)";

// Set things up
window.addEventListener("load", (event) => {
  boxElement = document.querySelector("#box");

  createObserver();
}, false);