Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
JavaScript function to check if an DOM element is on screen
$.fn.isOnScreen = function(){
var element = this.get(0);
var bounds = element.getBoundingClientRect();
return < window.innerHeight && bounds.bottom > 0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.