velocity is not a function materialize showing err

2019-06-14 17:54发布

问题:

materialize.js:3503 Uncaught TypeError: $(...).find(...).css(...).velocity is not a function
(anonymous function) @ materialize.js:3503
jQuery.event.dispatch @ jquery.js:4665
elemData.handle @ jquery.js:4333

error in console shows up when I click on card (materailize)

回答1:

It's Becuase you may be including another version on jquery in you head tag. When you install materailize with meteor it also adds jquery as its dependency. Both versions are conflicting with each other. All you need to do is exclude that jquery script tag in your head tag.



回答2:

To solve this is used the jquery version that is located in the materialize folder

window.$ = window.jQuery = require('materialize-css/node_modules/jquery/dist/jquery.js');
require('materialize-css');


回答3:

The module materialize is incomplete.

I have created a solution for this problem, available on GitHub:

Create without webpack and velocity error : https://github.com/webpremium/angular2-materialize-cordova