回答編集履歴

2

追記

2018/02/21 07:19

投稿

yambejp
yambejp

スコア115012

test CHANGED
@@ -24,9 +24,9 @@
24
24
 
25
25
  $(function(){
26
26
 
27
- $('html,body').animate({scrollTop:0 }, 0);
27
+ $('html,body').animate({scrollTop:0 }, 0)
28
28
 
29
- $('html,body').animate({scrollTop:$(location.hash).offset().top }, 500, 'swing');
29
+ .delay(1000).animate({scrollTop:$(location.hash).offset().top }, 1000, 'swing');
30
30
 
31
31
  });
32
32
 
@@ -45,3 +45,5 @@
45
45
  ```
46
46
 
47
47
  ※一部修正
48
+
49
+ 1秒間表示してから移動することにしました。

1

修正

2018/02/21 07:19

投稿

yambejp
yambejp

スコア115012

test CHANGED
@@ -24,11 +24,9 @@
24
24
 
25
25
  $(function(){
26
26
 
27
- var hash=location.hash;
27
+ $('html,body').animate({scrollTop:0 }, 0);
28
28
 
29
- location.hash="";
30
-
31
- $('html,body').animate({scrollTop:$(hash).offset().top }, 500, 'swing');
29
+ $('html,body').animate({scrollTop:$(location.hash).offset().top }, 500, 'swing');
32
30
 
33
31
  });
34
32
 
@@ -45,3 +43,5 @@
45
43
 
46
44
 
47
45
  ```
46
+
47
+ ※一部修正