回答編集履歴
2
追記
test
CHANGED
@@ -7,3 +7,127 @@
|
|
7
7
|
|
8
8
|
|
9
9
|
見つかったら追記しますが、取り急ぎ^^;
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
**追記**
|
14
|
+
|
15
|
+
以下の2箇所を修正しています。
|
16
|
+
|
17
|
+
元は[こちら](http://getbootstrap.com/javascript/#modals)
|
18
|
+
|
19
|
+
`<body class="modal-open">`
|
20
|
+
|
21
|
+
`<div class="modal in" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" style="display: block; padding-left: 0px;">`
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
あとポイントは、読み込み後に
|
26
|
+
|
27
|
+
```
|
28
|
+
|
29
|
+
$(window).on('load',function(){
|
30
|
+
|
31
|
+
$('#myModal').modal('show');
|
32
|
+
|
33
|
+
});
|
34
|
+
|
35
|
+
```
|
36
|
+
|
37
|
+
をしている点ですね。これでモーダルとして動きます。
|
38
|
+
|
39
|
+
ただ、こちらで確認できなかったのですが、チラツキは発生するかもしれないです。
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
```html
|
44
|
+
|
45
|
+
<!DOCTYPE html>
|
46
|
+
|
47
|
+
<head>
|
48
|
+
|
49
|
+
<meta charset="UTF-8" />
|
50
|
+
|
51
|
+
<title>test</title>
|
52
|
+
|
53
|
+
<!-- Latest compiled and minified CSS -->
|
54
|
+
|
55
|
+
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
|
56
|
+
|
57
|
+
<!-- Optional theme -->
|
58
|
+
|
59
|
+
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
|
60
|
+
|
61
|
+
</head>
|
62
|
+
|
63
|
+
<body class="modal-open">
|
64
|
+
|
65
|
+
<!-- Button trigger modal -->
|
66
|
+
|
67
|
+
<button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">
|
68
|
+
|
69
|
+
Launch demo modal
|
70
|
+
|
71
|
+
</button>
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
<!-- Modal -->
|
76
|
+
|
77
|
+
<div class="modal in" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" style="display: block; padding-left: 0px;">
|
78
|
+
|
79
|
+
<div class="modal-dialog" role="document">
|
80
|
+
|
81
|
+
<div class="modal-content">
|
82
|
+
|
83
|
+
<div class="modal-header">
|
84
|
+
|
85
|
+
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
86
|
+
|
87
|
+
<h4 class="modal-title" id="myModalLabel">Modal title</h4>
|
88
|
+
|
89
|
+
</div>
|
90
|
+
|
91
|
+
<div class="modal-body">
|
92
|
+
|
93
|
+
...
|
94
|
+
|
95
|
+
</div>
|
96
|
+
|
97
|
+
<div class="modal-footer">
|
98
|
+
|
99
|
+
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
100
|
+
|
101
|
+
<button type="button" class="btn btn-primary">Save changes</button>
|
102
|
+
|
103
|
+
</div>
|
104
|
+
|
105
|
+
</div>
|
106
|
+
|
107
|
+
</div>
|
108
|
+
|
109
|
+
</div>
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
<!-- Latest compiled and minified JavaScript -->
|
114
|
+
|
115
|
+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
|
116
|
+
|
117
|
+
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
|
118
|
+
|
119
|
+
<script>
|
120
|
+
|
121
|
+
$(window).on('load',function(){
|
122
|
+
|
123
|
+
$('#myModal').modal('show');
|
124
|
+
|
125
|
+
});
|
126
|
+
|
127
|
+
</script>
|
128
|
+
|
129
|
+
</body>
|
130
|
+
|
131
|
+
```
|
132
|
+
|
133
|
+
|
1
追記
test
CHANGED
File without changes
|