Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Offset option #16

Open
nicooprat opened this issue May 16, 2013 · 5 comments
Open

Offset option #16

nicooprat opened this issue May 16, 2013 · 5 comments

Comments

@nicooprat
Copy link

Would be great to add an option to provide an offset, so the "inview" event would be fired only when the element is visible from 100px for example.

I'm planning to use your plugin to animate elements when scrolling, but if the elements are only visible by a few pixels, the animation starts anyway... Not cool :)

Thanks for your work !

@markimark
Copy link

This is exactly what I also are looking for. Why is this feature so complicated to build in? There are so many similar codes out there but they all do not have that offset feature. Without that feature the use of the code is very limited. Would be very nice if the author could have a look to our request ;-)

@nicooprat
Copy link
Author

Found a similar jQuery plugin which seems to support an offset option (in the markup though, I guess it's a technical limitation) : https://github.com/morr/jquery.appear

@fadoe fadoe mentioned this issue Jan 28, 2015
@robertfausk
Copy link

@tiff Will there be any progress on this issue? Do you need further informations or help?

@columbian-chris
Copy link

Here's a quick and dirty (line 119 of current version):
if (elementOffset.top + elementSize.height > viewportOffset.top-250 && elementOffset.top+250 < viewportOffset.top + viewportSize.height && elementOffset.left + elementSize.width > viewportOffset.left && elementOffset.left < viewportOffset.left + viewportSize.width) {

Change the "250" to however many pixels you want the offset to be.

@coxrichuk
Copy link

+1

This would be really useful to add ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants