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

Change data attribute to data-scroll-reveal #24

Closed
jescalan opened this issue Mar 3, 2014 · 2 comments · Fixed by #25
Closed

Change data attribute to data-scroll-reveal #24

jescalan opened this issue Mar 3, 2014 · 2 comments · Fixed by #25
Labels

Comments

@jescalan
Copy link
Contributor

jescalan commented Mar 3, 2014

So the standard way of using data- attributes is to have them as all lower case and separated by dashes. By using data-scrollReveal, this plugin breaks convention. This also has practical implications. The html5 api for interacting with data attributes specifies that while dataset keys can be camelCase, they are transformed to dash case before being selection. For example:

var el = document.createElement('div');
el.dataset.scrollReveal = 'foo';
document.body.appendChild(el);

...results in the following in the html:

<div data-scroll-reveal='foo'></div>

As such, where camelCase can and should be used with dataset selections in the javascript, the html data attribute should be dash cased. Alternately, if you wanted to keep scrollReveal as a single word, if you drop the camelCase, you can use data-scrollreveal instead.

@jlmakes
Copy link
Owner

jlmakes commented Oct 13, 2014

This has been revisited; the attribute is now called data-sr

@jescalan
Copy link
Contributor Author

👍

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

Successfully merging a pull request may close this issue.

2 participants