回答編集履歴

2

typo

2022/12/27 03:14

投稿

yambejp
yambejp

スコア114814

test CHANGED
@@ -34,7 +34,7 @@
34
34
  $('#js-open').on('click',function(){
35
35
  $('#js-modal').dialog({
36
36
  modal:true,
37
- titile:"モーダルテスト",
37
+ title:"モーダルテスト",
38
38
  buttons:{
39
39
  "close":function(){
40
40
  $(this).dialog("close");

1

調整

2022/12/27 03:13

投稿

yambejp
yambejp

スコア114814

test CHANGED
@@ -21,3 +21,34 @@
21
21
  <p>コンテンツ・内容が入ります。</p>
22
22
  </dialog>
23
23
  ```
24
+
25
+ # 非推奨
26
+ 古いブラウザ環境をご利用ということであれば、開発終了してメンテナンスモードに入ったjQueryUIで処理するてもあります。
27
+ ```javascript
28
+ <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script>
29
+ <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
30
+ <link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css" />
31
+ <script>
32
+ $(function(){
33
+ $('#js-modal').hide();
34
+ $('#js-open').on('click',function(){
35
+ $('#js-modal').dialog({
36
+ modal:true,
37
+ titile:"モーダルテスト",
38
+ buttons:{
39
+ "close":function(){
40
+ $(this).dialog("close");
41
+ }
42
+ },
43
+ });
44
+ });
45
+ });
46
+
47
+ </script>
48
+ <button class="modal-open" id="js-open">モーダルウィンドウオープン</button>
49
+ <!-- 追記ここから -->
50
+ <div class="modal" id="js-modal">
51
+ <p>コンテンツ・内容が入ります。</p>
52
+ </div>
53
+ <!-- 追記ここまで -->
54
+ ```