JQueryでモーダルウィンドウの実装を試しています。
html
1<!--表示させるボタン--> 2<section> 3 <div class="attend"> 4プラン料金の詳細は<a id="open-reserve-page" class="orange ">こちら</a> 5 </div> 6</section> 7<!--予約プランの表示--> 8<section id="reserve" class=" reserve"> 9 <div class="title"><h2>ご予約</h2><i class="material-icons close-btn"></i></div> 10 11 ーー省略ーー 12 13</section>
js
1$(function(){ 2 $('#open-reserve-page').on('click',function(){ 3 $('#reserve').fadeIn(); 4 return false; 5 }); 6 $('.close-btn').on('click',function(){ 7 $('#reserve').fadeOut(); 8 return false; 9 }); 10 11});
CSS
1section#reserve{ 2 display: none; 3 height: 100vh; 4 width: 100%; 5 z-index: 2; 6 position: fixed; 7}
かいてみたところ反応がなくクリックしても何も起きません。
※<head>内に
<script type="text/javascript" src="(パス)"></script>
は記述済みです。
オーバーレイの設定をしていないからかも?と思いかきましたが反応がなかったので
jsの指定がおかしいのかと思いましたが原因が見つからず
他に思い当たる要因がじりきで見つけられず質問いたしました。
ご教授いただける方いましたら幸いです。
回答1件
あなたの回答
tips
プレビュー