UNPKG
viewability
Version:
latest (1.3.4)
1.3.4
1.3.3
1.3.2
1.2.7
1.2.6
1.2.5
1.2.4
1.2.3
1.2.2
1.2.1
1.2.0
1.1.2
1.1.1
1.1.0
1.0.1
1.0.0
Returns how viewable an element is
github.com/kahwee/viewability
kahwee/viewability
viewability
/
isElementOnScreen.js
10 lines
(9 loc)
•
264 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
var
horizontal =
require
(
'./horizontal'
)
var
vertical =
require
(
'./vertical'
)
module
.
exports
=
function
(
el, full
) {
if
(full) {
return
vertical
(el).
value
*
horizontal
(el).
value
===
1
}
else
{
return
vertical
(el).
value
*
horizontal
(el).
value
>
0
} }