I'm trying to get a MaterializeCSS dropdown menu working inside a card, but nothing is happening when I click on the button.
I've prepared a jsfiddle with the examples from the documentation and all the answers I could find on stackoverflow and google, yet I still cannot get it to work. What am I doing wrong?
https://jsfiddle.net/mozfet/3k4dkk6s/
html
<div class="row">
<div class="col s12">
<div class="card blue-grey darken-1">
<div class="card-content white-text">
<span class="card-title">Card Title</span>
<p>I am a very simple card. I am good at containing small bits of information. I am convenient because I require little markup to use effectively.</p>
</div>
<div class="card-action">
<a href="#">This is a link</a>
<!-- Dropdown Trigger -->
<a class='dropdown-button' href='#' data-activates='dropdown1'>Drop Me!</a>
<!-- Dropdown Structure -->
<ul id='dropdown1' class='dropdown-content'>
<li><a href="#!">one</a></li>
<li><a href="#!">two</a></li>
<li class="divider"></li>
<li><a href="#!">three</a></li>
</ul>
</div>
</div>
</div>
</div>
js
$(document).ready(function() {
console.log("intiate dropdown");
$('.dropdown-button').dropdown({
inDuration: 300,
outDuration: 225,
constrain_width: false,
hover: true,
gutter: 0,
belowOrigin: false,
alignment: 'left'
});
});
css
.card {
overflow: visible !important;
};