Skip to content

Commit 36082ae

Browse files
committed
scroll to selection in get started
1 parent 0ba0663 commit 36082ae

3 files changed

Lines changed: 13 additions & 1 deletion

File tree

content/start.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,23 @@ function showSubPage(id){
1111
const subpages=document.querySelectorAll(".qspage");
1212
subpages.forEach(sp=>sp.hidden=true);
1313
const selectedSubPage=document.querySelector(".qspage#"+id);
14+
if (!selectedSubPage) {
15+
return;
16+
}
1417
selectedSubPage.hidden=false;
1518

1619
const buttons=document.querySelectorAll("button.qsbtn");
1720
buttons.forEach(el=>el.classList.remove("highlightedCl"));
1821

1922
const selectedBtn=document.querySelector("button#"+id+"Btn");
20-
selectedBtn.classList.add("highlightedCl");
23+
if (selectedBtn) {
24+
selectedBtn.classList.add("highlightedCl");
25+
}
26+
27+
selectedSubPage.scrollIntoView({
28+
behavior: "smooth",
29+
block: "start"
30+
});
2131
}
2232
</script>
2333
<div id="qsbuttons">

static/css/pages/_start.less

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
box-shadow: none;
5656
}
5757
.qspage {
58+
scroll-margin-top: 6rem;
5859
background: rgba(23,23,27,0.58);
5960
border: 1px solid rgba(255,255,255,0.07);
6061
border-radius: 18px;

static/css/style.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1079,6 +1079,7 @@ nav li a.active {
10791079
box-shadow: none;
10801080
}
10811081
.qspage {
1082+
scroll-margin-top: 6rem;
10821083
background: rgba(23, 23, 27, 0.58);
10831084
border: 1px solid rgba(255, 255, 255, 0.07);
10841085
border-radius: 18px;

0 commit comments

Comments
 (0)