pageYOffset > y) { header.classList.add("sticky") ... You defined x to be an element and that's what you probably want to name "header".
確定! 回上一頁