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

Why do my animations reveal only once? #69

Closed
abdussami-tayyab opened this issue Aug 1, 2014 · 2 comments
Closed

Why do my animations reveal only once? #69

abdussami-tayyab opened this issue Aug 1, 2014 · 2 comments
Labels

Comments

@abdussami-tayyab
Copy link

http://jsfiddle.net/bfbda8t7/

This is the fiddle, as you can see both contents (mainContent and secondContent) are being revealed only once, even if I scroll miles downwards and come back up, they aren't revealed again.

As this awesome plugin depicts, an element is revealed every time it is in the viewport, mine just reveals once.

@jlmakes
Copy link
Owner

jlmakes commented Sep 4, 2014

http://jsfiddle.net/bfbda8t7/1/

The reset keyword does what you’re looking for, but it is set to false by default.

Single Element Reset

<div data-sr="enter right after 3s, and move 30px with reset"> Foo </div>

The above code will apply a reset only to that element.

Reset by Default

var config = { reset: true }
window.sr  = new scrollReveal( config )

The above code will apply reset to all elements.

Exclude Elements from Reset

Conversely, if you want to exclude an element from a reset: true default config, use the no reset keyword pair:

var config = { reset: true }
window.sr  = new scrollReveal( config )
<div data-sr="enter right after 3s, and move 30px with no reset"> Foo </div>

The above code will apply reset to all elements, except the one shown with no reset.

@jlmakes jlmakes closed this as completed Sep 4, 2014
@jlmakes jlmakes removed the bug label Sep 4, 2014
@abdussami-tayyab
Copy link
Author

Thank you very much! That makes the plugin even more powerful and wonderful! :D

@jlmakes jlmakes changed the title Element being revealed outside viewport Why do my animations reveal only once? Oct 18, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants