Skip to content
Advertisement

How to check if element is visible after scrolling?

I’m loading elements via AJAX. Some of them are only visible if you scroll down the page. Is there any way I can know if an element is now in the visible part of the page?

Advertisement

Answer

This should do the trick:

JavaScript

Simple Utility Function This will allow you to call a utility function that accepts the element you’re looking for and if you want the element to be fully in view or partially.

JavaScript

Usage

JavaScript
Advertisement