質問編集履歴

1

追記

2018/08/24 02:55

投稿

ami15821
ami15821

スコア56

test CHANGED
File without changes
test CHANGED
@@ -13,6 +13,46 @@
13
13
  ```
14
14
 
15
15
  エラーにはなっておりません
16
+
17
+ ```
18
+
19
+
20
+
21
+ ### 該当コード
22
+
23
+
24
+
25
+ ```
26
+
27
+ var wpcf7c_scroll = function(unit_tag) {
28
+
29
+ // エラーの時などにアンカーまでスクロール
30
+
31
+ jQuery(jQuery.find("input[name=_wpcf7_unit_tag]")).each(function(){
32
+
33
+ if(jQuery(this).val() == unit_tag) {
34
+
35
+ var parent = jQuery(this).parents("form");
36
+
37
+ var speed = 1000;
38
+
39
+ var position = parent.offset().top;
40
+
41
+ if(jQuery('.wpcf7c-anchor').length != 0) {
42
+
43
+ position = jQuery('.wpcf7c-anchor').offset().top;
44
+
45
+ }
46
+
47
+ jQuery("html, body").animate({scrollTop:position}, speed, "swing");
48
+
49
+ }
50
+
51
+ });
52
+
53
+ }
54
+
55
+
16
56
 
17
57
  ```
18
58