0

Sample design

I want to add a custom gradient style when the element is no longer visible inside the viewport. By default, the buttons are solid colors but when scrolled to the left outside the viewport, the edge should have a gradient such as this.

Ariel Magno
  • 1
  • 1
  • 1
  • https://stackoverflow.com/questions/45514676/react-check-if-element-is-visible-in-dom – possum Aug 28 '20 at 11:08
  • Does this answer your question? [React - check if element is visible in DOM](https://stackoverflow.com/questions/45514676/react-check-if-element-is-visible-in-dom) – possum Aug 28 '20 at 11:08
  • Is it not easier to overlay the edges of the viewport with a transparent-to-white gradient? – spender Aug 28 '20 at 11:17
  • Use Intersection Observer API to Detect if Element is in Viewport, details here – https://frontendguruji.com/blog/how-to-detect-if-element-is-in-viewport-intersection-observer-api/ – Mandeep Pasbola Mar 06 '23 at 06:06

0 Answers0