thenikso / angular-inview

AngularJS directive to check if a DOM element is in the browser viewport.
http://thenikso.github.io/angular-inview/
MIT License
480 stars 112 forks source link

Percent in offset not calculating correctly #131

Closed steevee closed 7 years ago

steevee commented 7 years ago

Say the rect.height = 300, when using something like this:

<div in-view="inView($inviewInfo)" in-view-options="{ offset: ['-25%',0] }">

The resulting element offset is calculated as: [-7500,0,-7500,0]

It should be: [-75,0,-75,0]