0

I have a react app and was wondering if there is any simple and easy way to determine if the user has scrolled to 25% of the screen?

if they scrolled to 25% of the screen i want to show a pop up but cant seem to determine that 25% mark.

Attiq Ahmed
  • 105
  • 7
  • [Duplicated] You can see the answer here. https://stackoverflow.com/a/8028584/5872950 To do this in react, just use the answer in componentDidMount lifecycle method, or in useEffect if you use hooks and assign the percentage to component state – Maged Mohamed Oct 21 '21 at 14:51
  • Your question is already answered here: https://stackoverflow.com/questions/2387136/cross-browser-method-to-determine-vertical-scroll-percentage-in-javascript – Melvynx Oct 21 '21 at 14:59

0 Answers0