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

Support nodeList as first reveal argument #246

Closed
jlmakes opened this issue Apr 5, 2016 · 3 comments
Closed

Support nodeList as first reveal argument #246

jlmakes opened this issue Apr 5, 2016 · 3 comments

Comments

@jlmakes
Copy link
Owner

jlmakes commented Apr 5, 2016

Selectors and nodes are already supported...

// selector
sr.reveal('#chocolate');

// node
var node = document.getElementById('chocolate');
sr.reveal(node);

✨ Let’s support NodeList! ✨

// node list
var nodeList = document.querySelectorAll('.chocolates');
sr.reveal(nodeList);

👍🏾

@jlmakes
Copy link
Owner Author

jlmakes commented Apr 5, 2016

Re: @orapouso #20

I will add support for this into the next release.

@orapouso
Copy link
Contributor

orapouso commented Apr 5, 2016

👍

@ryanjbonnell
Copy link

When this is added, perhaps a section on Advanced Selectors could be added to the documentation?

Here's a quick example I came up with:

// ScrollReveal using CSS Pseudo-Class Selector:
sr.reveal('h1:not(.no-animation)', {
  distance: '50px',
  origin: 'left'
});

This would animate all h1 elements, except those with the .no-animation class using a CSS pseudo-class selector:

<h1>This Will Animate</h1>

<h1 class="no-animation">No Animation</h1>

I'm happy to provide more use cases or code examples (CodePen, JSFiddle, etc).

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

No branches or pull requests

3 participants