Image captions appearing on scroll
-
Hi,
I have a simple one page site and wondered if there's a simple way to make image captions fade in on a scroll – perhaps at a fixed point (%) of the page height? Any pointers would be really helpful.
Many thanks in advance,
Norman -
so

if you have a caption for an image, it has the class ".caption"
so you'd need to use css to set the opacity to 0,
in lay options -> custom css & htmlthen use javascript:
use intersection observer
https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API
or window scroll event with getBoundingClientRect https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRecttogether with window.laytheme.on('newpageshown', function(){
})https://laytheme.com/documentation/custom-javascript.html#newpage-events