fix toc width

This commit is contained in:
飞雪无情
2019-12-21 21:25:07 +08:00
parent 5b068f5fcc
commit 57d088bf4c
3 changed files with 17 additions and 2 deletions
+4
View File
@@ -46,6 +46,10 @@ git clone https://github.com/flysnow-org/maupassant-hugo themes/maupassant
## 配置
#### 依赖要求
Hugo Version >= v 0.60.0
#### 应用主题
```toml
+4
View File
@@ -12,6 +12,10 @@ A simple Hugo template with great performance on different devices, ported from
## Features
#### Requirements
Hugo Version >= v 0.60.0
## Installation
```bash
+9 -2
View File
@@ -3,7 +3,7 @@
.post-toc {
position: fixed;
width: 200px;
margin-left: -220px;
margin-left: -210px;
padding: 5px 10px;
font-family: Athelas, STHeiti, Microsoft Yahei, serif;
font-size: 12px;
@@ -25,10 +25,12 @@
}
.post-toc .post-toc-title {
margin: 0 10px;
width: 100%;
margin: 0 auto;
font-size: 20px;
font-weight: 400;
text-transform: uppercase;
text-align: center;
}
.post-toc .post-toc-content {
@@ -68,6 +70,11 @@
$(document).ready(function () {
var postToc = $(".post-toc");
if (postToc.length) {
var leftPos = $("#main").offset().left;
if(leftPos<220){
postToc.css({"width":leftPos-10,"margin-left":(0-leftPos)})
}
var t = postToc.offset().top - 20,
a = {
start: {