Skip to content

Commit 9f17ca9

Browse files
committed
added animation to section scrolls
1 parent 89066fe commit 9f17ca9

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

js/main.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,15 @@ jQuery(document).on('ready', function() {
4848
scrollTop: jQuery("#tg-main").offset().top + offset
4949
}, 2000);
5050
});
51+
52+
/* -------------------------------------
53+
ADD ANIMATIONS TO SECTION SCROLL
54+
-------------------------------------- */
55+
$('a[href*=\\#]').on('click', function(event){
56+
event.preventDefault();
57+
$('html,body').animate({scrollTop:$(this.hash).offset().top}, 700);
58+
});
59+
5160
/* -------------------------------------
5261
NEXT EVENT COUNTER
5362
-------------------------------------- */

0 commit comments

Comments
 (0)