I AM LISTENING TO
|

WHAT I LIKE

Adding a Webfont Fallback for Email Templates in Outlook Fullpage.js / enhance SlimScroll to detect visible content for animations
Development     Javascript     jQuery    

Detecting if elements are visible in the current viewport



20. July 2015

BASIC CHECK

using getBoundingClientRect & jQuery.

“The returned value is a DOMRect object, which contains read-only left, top, right and bottom properties describing the border-box in pixels. top and left are relative to the top-left of the viewport.”

jQuery.visible

“This is a jQuery plugin which allows us to quickly check if an element is within the browsers visual viewport, regardless of the scroll position. If a user can see this element, the function will return true.”

Github

jQuery.isOnScreen

“Simple jQuery plugin to determine if an element is within the viewport. Optional parameters allow the user to specify a minimum percentage of the element’s dimensions that must be visible to qualify.”

Github

Enjoy coding …




Leave a Reply

Be the First to Comment!

Notify of
avatar