This commit is contained in:
Van
2019-04-02 11:37:02 +08:00
parent 8ab115ac53
commit 734a0979a7
20 changed files with 20 additions and 20 deletions

View File

@@ -1 +1 @@
var Skin={init:function(){Util.initPjax()},initArticle:function(){page.share();var l=$(".vditor-reset [id^=b3_solo_h]"),s=$(".article__toc"),c=$(".article__progress");1===s.length&&$(".post__toc").css("left",$(".article .item__content").offset().left+$(".article .item__content").outerWidth()-80),$(window).unbind("scroll").scroll(function(t){if(0===c.length)return!1;if(c.attr("value",parseInt($(window).scrollTop())).attr("max",parseInt($("body").outerHeight()-$(window).height())),236<$(window).scrollTop()?$(".article__top").css("top",0):$(".article__top").css("top",-61),0===$(".article__toc li").length||$(window).width()<1e3)return!1;if(975<$(window).scrollTop()&&$(window).scrollTop()<$(".article").outerHeight()+100){$(".post__toc").show();var i=[];l.each(function(t){i.push({id:this.id,offsetTop:this.offsetTop})});for(var o=$(window).scrollTop(),e=0,r=i.length;e<r;e++)if(o<i[e].offsetTop){s.find("li").removeClass("current");var n=0<e?e-1:0;s.find('a[href="#'+i[n].id+'"]').parent().addClass("current");break}o>=i[i.length-1].offsetTop&&(s.find("li").removeClass("current"),s.find("li:last").addClass("current"))}else $(".post__toc").hide()}),$(window).scroll()}};Skin.init();
var Skin={init:function(){Util.initPjax()},initArticle:function(){page.share();var l=$(".vditor-reset [id^=b3_solo_h]"),s=$(".article__toc"),c=$(".article__progress");1===s.length&&(876<$(window).width()?$(".post__toc").css("left",$(".article .item__content").offset().left+$(".article .item__content").outerWidth()-80):$(".post__toc a").click(function(){$(".post__toc").hide()})),$(window).unbind("scroll").scroll(function(t){if(0===c.length)return!1;if(c.attr("value",parseInt($(window).scrollTop())).attr("max",parseInt($("body").outerHeight()-$(window).height())),236<$(window).scrollTop()?$(".article__top").css("top",0):$(".article__top").css("top",-61),0===$(".article__toc li").length)return!1;876<$(window).width()&&(975<$(window).scrollTop()&&$(window).scrollTop()<$(".article").outerHeight()+100?$(".post__toc").show():$(".post__toc").hide());var o=[];l.each(function(t){o.push({id:this.id,offsetTop:this.offsetTop})});for(var i=$(window).scrollTop(),e=0,r=o.length;e<r;e++)if(i<o[e].offsetTop){s.find("li").removeClass("current");var n=0<e?e-1:0;s.find('a[href="#'+o[n].id+'"]').parent().addClass("current");break}i>=o[o.length-1].offsetTop&&(s.find("li").removeClass("current"),s.find("li:last").addClass("current"))}),$(window).scroll()}};Skin.init();