Change Text while scrolling
General Discussion
2
Posts
2
Posters
180
Views
1
Watching
-
I have different videos among each other and would like to show the caption at a certain scrollposition. Is that possible? How can I implent that?
I already have kind of a code snipetconst bodyTag = document.querySelector("body") const sections = document.querySelectorAll("section") const clientTag = document.querySelector("div.client") const headerTag = document.querySelector("header") document.addEventListener("scroll", function () { const pixels = window.pageYOffset sections.forEach(section => { if (section.offsetTop - 60 <= pixels) { const title = document.querySelector("div.title") // clientTag.innerHTML = section.getAttribute("data-client") clientTag.innerHTML = section.getAttribute("data-client") } }) }) -
Waypoints does this...
http://imakewebthings.com/waypoints/Ex in LAY, add/remove a CSS class on the 'index' : https://kiti.ca/kitty-care
Doesn't work as well on mobile... working on it.
Online Users
Forgot your key, lost your files, need a previous Lay Theme or Addon version?
Go to www.laykeymanager.com