mirror of
https://github.com/kubesphere/website.git
synced 2025-12-26 00:12:48 +00:00
change table of contents
This commit is contained in:
parent
90b8aef649
commit
311e945e15
|
|
@ -149,21 +149,25 @@
|
|||
}
|
||||
|
||||
.tabs {
|
||||
li {
|
||||
margin: 4px 0;
|
||||
font-size: 16px;
|
||||
#TableOfContents > ul > li > a {
|
||||
font-weight: 500;
|
||||
}
|
||||
li {
|
||||
margin: 10px 0;
|
||||
font-size: 16px;
|
||||
line-height: 2;
|
||||
color: #36435c;
|
||||
|
||||
a {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 32px;
|
||||
font-weight: 400;
|
||||
line-height: 24px;
|
||||
color: #36435c;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
|
||||
&:hover {
|
||||
color: #55bc8a;
|
||||
}
|
||||
}
|
||||
}
|
||||
li li {
|
||||
|
|
|
|||
|
|
@ -24,4 +24,22 @@ var bindAsideScroll = function() {
|
|||
}
|
||||
});
|
||||
}
|
||||
bindAsideScroll()
|
||||
|
||||
var bindClickLink = function() {
|
||||
var aside = $('.aside')
|
||||
var headerHeight = $('header').outerHeight()
|
||||
aside.find('a').click(function(event) {
|
||||
event.preventDefault()
|
||||
var id = $(this).attr('href')
|
||||
scrollToElement(id, headerHeight)
|
||||
})
|
||||
}
|
||||
|
||||
var scrollToElement = function(id, headerHeight) {
|
||||
var element = $(id)
|
||||
var toTop = element.offset().top
|
||||
window.scrollTo(0, toTop - headerHeight)
|
||||
}
|
||||
|
||||
bindAsideScroll()
|
||||
bindClickLink()
|
||||
Loading…
Reference in New Issue