back
Dynamic elements
After inserting elements or changing layout, request an update:
container.insertAdjacentHTML('beforeend', '<div data-lg-reveal="fade">New content</div>')
luge.emitter.emit('update')
Reveal, ScrollAnimation, MouseAnimation, Parallax, Intersection and LottiePlayer discover newly added matching elements; Transition rebinds links. Observers recalculate bounds asynchronously through the ticker. Register an afterScrollUpdate listener before emitting update when you need the updated scroll measurements.
update is not a universal destroy/reinitialize operation. It does not automatically reconcile every removed element or changed attribute. Use luge.lifecycle.refresh() after externally replacing a page and test the relevant plugin lifecycle.
update does not initialize a newly inserted cursor or preloader, or enable SmoothScroll after startup. See known limitations.