回答編集履歴

2

追記

2015/10/19 08:24

投稿

退会済みユーザー
test CHANGED
@@ -51,3 +51,53 @@
51
51
  こうなった。
52
52
 
53
53
  ![こうなった](79722fdb6bb3f77ea62dc98b4680db4a.png)
54
+
55
+
56
+
57
+ ---
58
+
59
+
60
+
61
+ ```html
62
+
63
+ <!DOCTYPE HTML>
64
+
65
+ <html lang="ja-JP">
66
+
67
+ <head>
68
+
69
+ <meta charset="UTF-8">
70
+
71
+ <title></title>
72
+
73
+ </head>
74
+
75
+ <body>
76
+
77
+ <script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
78
+
79
+ <script type="text/javascript">
80
+
81
+ $(window).on('load resize', function (e) {
82
+
83
+ console.log(e.type);
84
+
85
+ console.log(e.target);
86
+
87
+ });
88
+
89
+ </script>
90
+
91
+ </body>
92
+
93
+ </html>
94
+
95
+ ```
96
+
97
+
98
+
99
+ のとき
100
+
101
+
102
+
103
+ ![イメージ説明](870a2237e8a91e1ef90b8a82b3c2320f.png)

1

追記

2015/10/19 08:24

投稿

退会済みユーザー
test CHANGED
@@ -1 +1,53 @@
1
1
  load されるのは window じゃなくて、 documentだからではないでしょうか?
2
+
3
+
4
+
5
+ ---
6
+
7
+
8
+
9
+ と推測したけど…
10
+
11
+
12
+
13
+ ```html
14
+
15
+ <!DOCTYPE HTML>
16
+
17
+ <html lang="ja-JP">
18
+
19
+ <head>
20
+
21
+ <meta charset="UTF-8">
22
+
23
+ <title></title>
24
+
25
+ </head>
26
+
27
+ <body>
28
+
29
+ <script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
30
+
31
+ <script type="text/javascript">
32
+
33
+ $(window).on('resize load', function (e) {
34
+
35
+ console.log(e.type);
36
+
37
+ console.log(e.target);
38
+
39
+ }).trigger('resize');
40
+
41
+ </script>
42
+
43
+ </body>
44
+
45
+ </html>
46
+
47
+ ```
48
+
49
+
50
+
51
+ こうなった。
52
+
53
+ ![こうなった](79722fdb6bb3f77ea62dc98b4680db4a.png)