実現したいこと
モーダル内の「閉じるのボタン」をLP内にある問い合わせまで飛ぶように設定したいです。
jQueryで上書きする場合どのようなコードになるでしょうか。
よろしくお願いいたします。
『Remodal』↓
https://vodkabears.github.io/remodal/
発生している問題・分からないこと
すでに設定されているボタンとは別にaタグでボタンを作成し、
jQueryでモーダルが閉じるように設定してみたのですが、うまく作動しないです。
該当のソースコード
HTML
1 2<section class="modal_space"> 3 <a href="#modal_02" class="btn btn_pink">詳細はこちら</a> 4 <div class="remodal" data-remodal-id="modal_02"> 5 <div class="remodal-rerative"> 6 <div data-remodal-action="cancel" class="remodal-cancel remodal-cancel_btn">×</div> 7 <p class="modal_maintitle">求人詳細</p> 8 <ul class="modal_list"> 9 <li class="modal_item"> 10 <p class="modal_title">最寄り駅</p> 11 <p class="modal_txt">東京メトロ南北線沿線</p> 12 </li> 13 <li class="modal_item"> 14 <p class="modal_title">定員数</p> 15 <p class="modal_txt">64名</p> 16 </li> 17 <li class="modal_item"> 18 <p class="modal_title">勤務時間</p> 19 <p class="modal_txt">13:00 ~ 18:00/13:30 ~ 18:30</p> 20 </li> 21 <li class="modal_item"> 22 <p class="modal_title">勤務日</p> 23 <p class="modal_txt">月~金/週1 ~ 2日</p> 24 </li> 25 <li class="modal_item"> 26 <p class="modal_title">担当業務</p> 27 <p class="modal_txt">フリー、保育補助</p> 28 </li> 29 <li class="modal_item"> 30 <p class="modal_title">待遇</p> 31 <p class="modal_txt">有給休暇・産育休あり・交通費全額支給・社会保険完備</p> 32 </li> 33 </ul> 34 </div> 35 <button data-remodal-action="cancel" class="remodal-cancel">閉じる</button> 36 </div> 37 </section>
CSS
1/* modal */ 2.btn { 3 display: flex; 4 justify-content: center; 5 align-items: center; 6 width: 240px; 7 height: 38px; 8 box-sizing: border-box; 9 text-decoration: none; 10 transition-duration: 0.3s; 11 font-family: "M PLUS Rounded 1c", sans-serif; 12 font-size: 1rem; 13 font-weight: 600; 14 color: #f68210; 15 border: 2px solid #f68210; 16 background: transparent; 17 text-align: center; 18 border-radius: 20px; 19 position: relative; 20 top: -119px; 21 margin: 0 auto; 22} 23.btn:hover { 24 background: #b4b1a0; 25 color: #ffffff; 26} 27 28.btn_pink{ 29 color: #fd5a56; 30 border: 2px solid #fd5a56; 31} 32 33.remodal { 34 position: relative; 35 padding: 35px; 36} 37.remodal img { 38 width: 100%; 39 height: auto; 40 vertical-align: top; 41} 42.remodal-cancel { 43 color: #fff; 44 background: #f68210; 45 width: 100%; 46 margin-top: 25px; 47} 48.remodal-cancel:hover { 49 background: #333; 50} 51 52.remodal-cancel_btn{ 53 position: absolute; 54 top: -2%; 55 left: 75%; 56 font-size: 1rem; 57 color: #fff; 58 background: #f68210; 59 width: 0%; 60 text-align: center; 61} 62 63.modal_space{ 64 margin-bottom: -70px; 65} 66 67.modal_maintitle{ 68 font-family: "M PLUS Rounded 1c", sans-serif; 69 font-size: 1.4rem; 70 font-weight: 700; 71 color: #f68210; 72 text-align: left; 73} 74 75.modal_title{ 76 font-family: "M PLUS Rounded 1c", sans-serif; 77 font-size: 1.2rem; 78 font-weight: 550; 79 color: #f68210; 80} 81 82.modal_txt{ 83 font-family: "M PLUS Rounded 1c", sans-serif; 84 font-size: 1rem; 85 font-weight: 500; 86 color: #54393d; 87 margin-top: 10px; 88} 89 90.modal_list{ 91 margin: 10px 0px; 92} 93 94.modal_item{ 95 margin-top: 20px; 96 text-align: left; 97} 98 99.modal_item::after{ 100 content: ""; 101 width: 100%; 102 height: 1px; 103 background-color: #f68210; 104 display: block; 105 margin-top: 5px; 106} 107 108```jQueryはRemodalのremodal.min.jsを使用 109 110### 試したこと・調べたこと 111- [x] teratailやGoogle等で検索した 112- [ ] ソースコードを自分なりに変更した 113- [ ] 知人に聞いた 114- [ ] その他 115 116##### 上記の詳細・結果 117『Remodal』のボタンカスタマイズは出てきませんでした。 118 119### 補足 120特になし
回答1件
あなたの回答
tips
プレビュー