Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript moving text from left to right onscroll

var text = document.querySelector("h1");
document.addEventListener("scroll", () => {
  text.style.left = window.scrollY * 5 + "px";
});
 
PREVIOUS NEXT
Tagged: #javascript #moving #text #left #onscroll
ADD COMMENT
Topic
Name
8+3 =