$(document).ready(function(){function t(){i.filter(function(){var t=$(this);if(t.attr("src"))return!1;var a=t[0].getClientRects();return a.length>0&&a[0].top>0&&a[0].top<$(window).height()}).each(function(){$(this).attr("src",$(this).data("src"))})}var a=$(".page-detail h2");a.length>0&&a.each(function(t){var a='href="#'+$(this).attr("id")+'"',e=$(this).text();$(this).next(".time")&&(e+=" "+$(this).next(".time").text());var i=0===t?' class="active"':" ",n=$(""+e+"").click(function(){$(".page-nav a").removeClass("active"),$(this).addClass("active")});$(".page-nav ul").append($("
  • ").append(n))});var e=$(".page-content"),i=e.find("iframe");t(),$(window).scroll(function(){t()}),$(".slide-btn").click(function(){var t=$(this).parent().parent();t.hasClass("slide-up")?($(this).text("收起目录"),t.removeClass("slide-up")):($(this).text("展开目录"),t.addClass("slide-up"))}),$(".page-nav")&&$(window).scroll(function(){var t=120,a=Math.max(120-(window.pageYOffset-t),70);$(".page-nav").css("top",a)})});