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

Not working with semantic-ui? #188

Closed
Maxhodges opened this issue Nov 21, 2015 · 5 comments
Closed

Not working with semantic-ui? #188

Maxhodges opened this issue Nov 21, 2015 · 5 comments
Labels

Comments

@Maxhodges
Copy link

I tried everything I could think of, but can't get it to work in semantic-ui. Anyone have similar problems and any workarounds?

Do I need jquery? If so, what version? I'm using:

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>

You can see my project source here:
https://github.com/white-rabbit-japan/wreHomePage/tree/feature/scrollReveal

Cheers! 🍻

@jlmakes
Copy link
Owner

jlmakes commented Nov 21, 2015

ScrollReveal does not require jQuery.

It looks like you are using the 3.0 release candidate, so you must call the init() method.

window.sr = new scrollReveal();
sr.init();

// or chained
window.sr = new scrollReveal().init();

Check out the 3.0 pull request (#168) for more information and sample code. Sorry for any confusion, the documentation will be updated shortly to reflect the new changes! 🙇

@jlmakes jlmakes changed the title doesn't work in semantic-ui Not working with semantic-ui? Nov 21, 2015
@Maxhodges
Copy link
Author

Hi @jlmakes thanks for the reply. I can sr in console and see that it was uninitialized. I ran init() and that fixes it. I thought it was suppose to self-initialize. Maybe mentioning that we need to run init() in the docs would spare others a great deal of time.

image

except for my init() problem, ScrollReveal is fantastic. Thanks so much for taking the time to share it!

Cheers!

@jlmakes
Copy link
Owner

jlmakes commented Nov 22, 2015

I thought it was suppose to self-initialize. Maybe mentioning that we need to run init() in the docs would spare others a great deal of time.

You’re right, and previous versions did automatically initialize on instantiation.

The main reason is that with the new JavaScript API in 3.0, it’s necessary to separate the instantiation and initialization—simple example:

// instantiate
window.sr = new scrollReveal();

// use JS API to configure reveals
sr.reveal( '.myClass', "enter top after 1s" );

// initialize
sr.init();

I’m working on updating the docs for 3.0 right now! 🙇

P.S. I need to think it through a bit more, but I suppose it’s possible ScrollReveal could initialize on instantiation like it did previously—but one would still need to initialize after using reveal()

@Maxhodges
Copy link
Author

here's what I made with it
https://www.whiterabbitexpress.com/

Thanks for scrollReveal!

@jlmakes
Copy link
Owner

jlmakes commented Nov 23, 2015

@Maxhodges Awesome! It’s my pleasure.

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