Answers for "if element is fully visible in viewport jquery"

-1

if element is fully visible in viewport jquery

$.fn.isInViewport = function() {var elementTop = $(this).offset().top;var elementBottom = elementTop + $(this).outerHeight();var viewportTop = $(window).scrollTop();var viewportBottom = viewportTop + $(window).height();return elementBottom > viewportTop && elementTop < viewportBottom;};
Posted by: Guest on February-10-2021

Code answers related to "if element is fully visible in viewport jquery"

Code answers related to "Javascript"

Browse Popular Code Answers by Language