k3nsei/ng-in-viewport

Threshold not working as expected or i miss-understood the conf.

Closed this issue · 1 comments

First of all thank you for this plugin. If you could also provide a more thorough documentation at least for the options of the directive it would be great.

What I'm trying to achieve is that i want a div to be "active" i.e. receive an active class when it is 70% inside the viewport. This worked when providing a threshold of 0.7 or [0.7,1]. Now i would also like the div to receive an "inactive" class once it is 70% or more hidden.

I really tried a lot of configurations but the expected outcome does not seem to be achievable. The divs are activated once more than 70% of each div is shown but i get no event when 70% or more of the div is hidden.

Perhaps i miss-understood how the threshold works.

Any support is appreciated thank you.

Answer: Link

NOTE: I modified the example to have a threshold of 75% i.e. threshold:0.75