Skip to content

Commit a47babe

Browse files
authored
Merge pull request #6390 from Jentsch/Fix-Scrolling
Fix smooth scrolling on index doc page
2 parents 673febf + fbcd79f commit a47babe

File tree

2 files changed

+1
-17
lines changed

2 files changed

+1
-17
lines changed

docs/css/default.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
html, body {
88
box-sizing: border-box;
9+
scroll-behavior: smooth;
910
}
1011

1112
*, *:before, *:after {

docs/js/index.js

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,4 @@
11
$(document).ready(function() {
22
window.sr = ScrollReveal();
33
sr.reveal(".scala-logo-container", { duration: 2000, delay: 100, mobile: false });
4-
5-
var hostname = new RegExp(location.host);
6-
$('a').each(function(){
7-
var url = $(this).attr("href");
8-
if (hostname.test(url) || url.slice(0, 1) == "#")
9-
$(this).addClass('local');
10-
});
11-
12-
$("a").on('click', function(event) {
13-
if ($(this).hasClass("local") && this.hash != "") {
14-
event.preventDefault();
15-
var hash = this.hash;
16-
$('html, body').animate({ scrollTop: $(hash).offset().top }, 800, function() {
17-
window.location.hash = hash;
18-
});
19-
}
20-
});
214
});

0 commit comments

Comments
 (0)