質問編集履歴

2

質問内容の詳細を記載いたしました。

2016/06/02 08:06

投稿

cat0138
cat0138

スコア33

test CHANGED
File without changes
test CHANGED
@@ -5,10 +5,6 @@
5
5
  フォームを実装したいのですが、colorbox.js内で「jquery.js」を読み込んでいるはずなのに「Uncaught TypeError」が出てしまいます。
6
6
 
7
7
  何か別の方法で実装する必要があるのでしょうか?
8
-
9
-
10
-
11
-
12
8
 
13
9
 
14
10
 
@@ -20,7 +16,7 @@
20
16
 
21
17
  ```
22
18
 
23
- $(".ボタンのクラス名").click(function(){
19
+ $(".btnClose02").click(function(){
24
20
 
25
21
  $('#testid').parents().colorbox.close();
26
22
 
@@ -45,8 +41,6 @@
45
41
  ###補足
46
42
 
47
43
  さらに必要な情報がございましたら、お手数ですが教えて頂いてもよろしいでしょうか?
48
-
49
-
50
44
 
51
45
 
52
46
 
@@ -77,3 +71,103 @@
77
71
  </head>
78
72
 
79
73
  ```
74
+
75
+
76
+
77
+ ###「colorbox」の詳細
78
+
79
+ iframeで実装されているものは下記になります。また、testidのオブジェクトについても記載しております。
80
+
81
+ ```
82
+
83
+ <!DOCTYPE html>
84
+
85
+ <html lang="ja">
86
+
87
+ <head>
88
+
89
+ <meta charset="utf-8">
90
+
91
+ <title><?php echo $title; ?></title>
92
+
93
+ <script type="text/javascript" src="省略/wordpress/wp-includes/js/jquery/jquery.js?ver=1.12.3"></script>
94
+
95
+ <script type="text/javascript" src="省略/wordpress/wp-includes/js/jquery/jquery-migrate.min.js?ver=1.4.0"></script>
96
+
97
+ </head>
98
+
99
+ <body id="testid">
100
+
101
+ <section id="test07" class="">
102
+
103
+ <h1 class=""><img src="" width="" height="" alt=""></h1>
104
+
105
+ <p class=""><img src="" width="" height="" alt=""></p>
106
+
107
+ <p class=""><img src="" width="" height="" alt=""></p>
108
+
109
+ <p class=""><img src="" width="" height="" alt=""></p>
110
+
111
+ <p class="btnClose02"><a href="#"><img src="" width="" height="" alt="閉じる"></a></p>
112
+
113
+ </section>
114
+
115
+ <script type="text/javascript">
116
+
117
+ (function ($) {
118
+
119
+ jQuery(function ($) {
120
+
121
+ $("btnClose02").click(function(){
122
+
123
+ $('#testid').parents().colorbox.close();
124
+
125
+ return false;
126
+
127
+ });
128
+
129
+ })
130
+
131
+ })(jQuery);
132
+
133
+ </script>
134
+
135
+ </body>
136
+
137
+ </html>
138
+
139
+ ```
140
+
141
+ また、colorboxは下記のように設定しております。
142
+
143
+ ```
144
+
145
+ <section id="testname">
146
+
147
+ <p class="btn"><a href="/test07.php"><img src="" width="" height="" alt=""></a></p>
148
+
149
+ </section>
150
+
151
+ ```
152
+
153
+ ```
154
+
155
+ <script>
156
+
157
+ jQuery(function($) {
158
+
159
+ $("#testname").find("a").colorbox({
160
+
161
+ iframe: true,
162
+
163
+ width: "936px",
164
+
165
+ height: "395px"
166
+
167
+ });
168
+
169
+ })
170
+
171
+ </script>
172
+
173
+ ```

1

htmlの記述を追加いたしました。

2016/06/02 08:06

投稿

cat0138
cat0138

スコア33

test CHANGED
File without changes
test CHANGED
@@ -45,3 +45,35 @@
45
45
  ###補足
46
46
 
47
47
  さらに必要な情報がございましたら、お手数ですが教えて頂いてもよろしいでしょうか?
48
+
49
+
50
+
51
+
52
+
53
+ ###追加情報
54
+
55
+ 動かないボタンは、下記になります。
56
+
57
+ ```
58
+
59
+ <p class="ボタンのクラス名"><a href="#"><img src="画像パス" width="" height="" alt="閉じる"></a></p>
60
+
61
+ ```
62
+
63
+
64
+
65
+ iframeで実装しておりまして、headerタグの中にjqueryを読み込むタグも記述しているのですが。。。
66
+
67
+ ```
68
+
69
+ <head>
70
+
71
+ 省略
72
+
73
+ <script type="text/javascript" src="省略/wordpress/wp-includes/js/jquery/jquery.js?ver=1.12.3"></script>
74
+
75
+ <script type="text/javascript" src="省略/wordpress/wp-includes/js/jquery/jquery-migrate.min.js?ver=1.4.0"></script>
76
+
77
+ </head>
78
+
79
+ ```