问题
I'm having trouble getting the Materialize CSS multiple select box to work.
I know about the javascript function material_select
that needs to be called.
JSFiddle
Documentation
Any help appriciated, perhaps I'm just missing something.
回答1:
Did you included the script/stylesheet?
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.2/css/materialize.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.2/js/materialize.min.js"></script>
Working: https://jsfiddle.net/8kdo8ndb/3/
回答2:
Include following tag under <head>
tag -
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.2/css/materialize.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.2/js/materialize.min.js"></script>
If you dont not waht to use CDN, You have make structure of files like -
MyWebsite/
|--css/
| |--materialize.css
|
|--font/
| |--material-design-icons/
| |--roboto/
|
|--js/
| |--materialize.js
|
|--index.html
来源:https://stackoverflow.com/questions/33700603/materializecss-multiple-select-not-working