, 최신 버전을 사용하는 경우, 당신은
$(document).ready(function(){
// the "href" attribute of .modal-trigger must specify the modal ID that wants to be triggered
$('.modal').modal();
});
이 차이를 볼 사용할 필요가? 당신이 여기
.modal
라는 클래스가있을 때 대신 leanModal()
사용도 modal()
당신이 $('.modal1')
를 사용하는 것은이
$(document).ready(function(){
// the "href" attribute of .modal-trigger must specify the modal ID that wants to be triggered
$('.modal').modal();
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.98.2/css/materialize.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.98.2/js/materialize.min.js"></script>
<a class="waves-effect waves-light btn" href="#modal1">Modal</a>
<div id="modal1" class="modal">
<div class="modal-content">
<h4>Modal Header</h4>
<p>A bunch of text</p>
</div>
</div>
니펫 워킹이 제대로 구체화의 CSS와 JS를 가져온 것입니다 파일? 콘솔 오류가없는 것 같아서 JS 파일이 누락 된 것 같습니다. 그렇다면 쇼를 보여 주시면 문제를 더 잘 이해할 수 있습니다. –
예 구현했습니다
–