This commit is contained in:
parent
dfc58496ed
commit
8ab115ac53
@ -41,6 +41,7 @@
|
|||||||
<@header type="article"></@header>
|
<@header type="article"></@header>
|
||||||
<div class="article__top">
|
<div class="article__top">
|
||||||
<div class="fn__clear">
|
<div class="fn__clear">
|
||||||
|
<div class="toc fn__none" onclick="$('.post__toc').slideToggle()">${tocLabel}</div>
|
||||||
<div class="title fn__pointer" onclick="Util.goTop()">${article.articleTitle}</div>
|
<div class="title fn__pointer" onclick="Util.goTop()">${article.articleTitle}</div>
|
||||||
<#include "../../common-template/share.ftl">
|
<#include "../../common-template/share.ftl">
|
||||||
</div>
|
</div>
|
||||||
|
File diff suppressed because one or more lines are too long
@ -747,6 +747,13 @@ a {
|
|||||||
.title {
|
.title {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
.toc {
|
||||||
|
display: block;
|
||||||
|
float: left;
|
||||||
|
line-height: 40px;
|
||||||
|
padding: 0 10px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
&__share .item {
|
&__share .item {
|
||||||
height: 40px;
|
height: 40px;
|
||||||
@ -807,4 +814,12 @@ a {
|
|||||||
margin-bottom: 40px;
|
margin-bottom: 40px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.post__toc {
|
||||||
|
left: 0;
|
||||||
|
background-color: #fff;
|
||||||
|
width: 100%;
|
||||||
|
top: 41px;
|
||||||
|
bottom: 0;
|
||||||
|
}
|
||||||
}
|
}
|
@ -38,9 +38,15 @@ var Skin = {
|
|||||||
var $articleProgress = $('.article__progress')
|
var $articleProgress = $('.article__progress')
|
||||||
|
|
||||||
if ($articleToc.length === 1) {
|
if ($articleToc.length === 1) {
|
||||||
$('.post__toc').
|
if ($(window).width() > 876) {
|
||||||
css('left', $('.article .item__content').offset().left +
|
$('.post__toc').
|
||||||
$('.article .item__content').outerWidth() - 80)
|
css('left', $('.article .item__content').offset().left +
|
||||||
|
$('.article .item__content').outerWidth() - 80)
|
||||||
|
} else {
|
||||||
|
$('.post__toc a').click(function () {
|
||||||
|
$('.post__toc').hide()
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$(window).unbind('scroll').scroll(function (event) {
|
$(window).unbind('scroll').scroll(function (event) {
|
||||||
@ -58,16 +64,17 @@ var Skin = {
|
|||||||
$('.article__top').css('top', -61)
|
$('.article__top').css('top', -61)
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($('.article__toc li').length === 0 || $(window).width() < 1000) {
|
if ($('.article__toc li').length === 0) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($(window).scrollTop() > 975 && $(window).scrollTop() <
|
if ($(window).width() > 876) {
|
||||||
$('.article').outerHeight() + 100) {
|
if ($(window).scrollTop() > 975 && $(window).scrollTop() <
|
||||||
$('.post__toc').show()
|
$('.article').outerHeight() + 100) {
|
||||||
} else {
|
$('.post__toc').show()
|
||||||
$('.post__toc').hide()
|
} else {
|
||||||
return
|
$('.post__toc').hide()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 界面各种图片加载会导致帖子目录定位
|
// 界面各种图片加载会导致帖子目录定位
|
||||||
|
Loading…
x
Reference in New Issue
Block a user