mkhairi / materialize-sass

Materializecss rubygem for Rails Asset Pipeline / Sprockets
http://materialize.labs.my/
MIT License
805 stars 243 forks source link

TypeError: $(...).parallax is not a function(anonymous function) #97

Closed DevilsNightsix closed 8 years ago

DevilsNightsix commented 8 years ago

I've got this error, when trying to initialize parallax

index.js:5 Uncaught TypeError: $(...).parallax is not a function(anonymous function) 
@ index.js:5fire 
@ jquery.js:3232self.fireWith 
@ jquery.js:3362jQuery.extend.ready 
@ jquery.js:3582completed 
@ jquery.js:3617 VM16009:88 Ember Inspector Active

my aplication.js

//= require jquery
//= require materialize-sprockes
//= require materialize/extras/nouislider
//= require jquery_ujs
//= require_tree .

I see in the inspector that the files loaded, but looks like plugins are not initialized.

abartier commented 8 years ago

Hi,

You've got a typo there:

//= require materialize-sprockes

Should be

//= require materialize-sprockets

But you said the files loaded that's strange. Can you past some code where you initialize the parallax?

DevilsNightsix commented 8 years ago

@abartier Thanks, but error was caused because i'm trying to use materialize-sass with ember-cli-rails.

Ember-cli-rails includes it's own jquery, that overrides jquery defined with rails assets-pipeline.

So my solution was to install materialize as bower component and include javascript files in ember-cli-build.js.

abartier commented 8 years ago

Ok, good to know for the ember-cli.

Is it good enough to close this issue?

DevilsNightsix commented 8 years ago

Yep.