Skip to content
Advertisement

Tag: viewport

Howto: add class when section is in viewport

I am trying to get a drawing animation effect similar to https://stackoverflow.com/a/45378478 (Preview: https://codepen.io/jbanegas/pen/LjpXom) to load when the user scrolls to this section of the page. It’s intended to add multiple of these drawing boxes as the user navigates the page. I realize that jQuery is sort of outdated now, but this is on a WordPress website that already utilizes

Get viewport/window height in ReactJS

How do I get the viewport height in ReactJS? In normal JavaScript I use but using ReactJS, I’m not sure how to get this information. My understanding is that only works for components created. However this is not the case for the document or body element, which could give me height of the window. Answer Set the props viewport height

Advertisement