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

Cannot set property 'Rellax' of undefined. #22

Closed
btn0s opened this issue Nov 2, 2016 · 7 comments
Closed

Cannot set property 'Rellax' of undefined. #22

btn0s opened this issue Nov 2, 2016 · 7 comments

Comments

@btn0s
Copy link

btn0s commented Nov 2, 2016

I'm getting this error coming from this line.

https://github.com/dixonandmoe/rellax/blob/master/rellax.js#L23

Am I doing something wrong or is this common?

@moeamaya
Copy link
Member

How are you integrating the library (npm, basic download)??

@btn0s
Copy link
Author

btn0s commented Nov 13, 2016

I just copied the raw code and put it in a new file in my project.

@moeamaya
Copy link
Member

moeamaya commented Nov 13, 2016

Make sure you're referencing that new file before you call Rellax.

<script src="newfile.js"></script>
<script>
  // Accepts any class name
  var rellax = new Rellax('.rellax');
</script>

Let me know if this works

@btn0s
Copy link
Author

btn0s commented Nov 15, 2016

Okay. Currently my build system takes all the JS and puts it together in one file... do you think that might be causing the problem?

@moeamaya
Copy link
Member

Yea that seems like a possible culprit. Make sure that you include your custom javascript the part where you wrote var rellax = new Rellax() after the rellax.js file. Often it's called main.js or something similar.

@moeamaya
Copy link
Member

@btn0s Did that end up working?

@btn0s
Copy link
Author

btn0s commented Nov 24, 2016

Hey sorry been really busy, yeah that fixed it. :)

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

2 participants