Skip to content

Return the number of pixels an element can be scrolled by in all directions

Notifications You must be signed in to change notification settings

KoryNunn/can-scroll

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

can-scroll

Return the number of pixels an element can be scrolled by in all directions

usage

canScroll(element) will recurse up the DOM tree of an element and add up the scrollable distance on all of its offsetParents

canScroll(someElement);

// -> {up: 10, down: 20, left: 0, right: 0}

If you only care about the scrollability of the target element, you can use canScroll.canScrollSelf(element), which does not recurse.

About

Return the number of pixels an element can be scrolled by in all directions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published