博客园主题响应式布局

darkgreentrip

这里以主题darkgreentrip为例,其它主题类似。

响应式布局

在后台设置里页面定制CSS代码加上以下代码:

@-webkit-viewport { device-width;}
@-moz-viewport { device-width;}
@-ms-viewport { device-width;}
@-o-viewport { device-width;}
@viewport { device-width;}

#main {min- 0px !important; }

.cnblogs-markdown .hljs {font-size: 16px!important;}

@media (max-990px) {
	#home{ margin:0 0px; }
}
@media (max-900px) {
	#sideBar, #mainContent{ 100%;margin-right:0px !important;}
	.post{ border-left:none; }
	#mainContent {float: none !important;}
	#mainContent .forFlow{margin-left:0em !important;}
	#main { padding: 20px 0 0 0px;overflow: hidden;}

	#cnblogs_post_body img{100% ;}

	.cnblogs_code_copy img{auto !important;}
	.cnblogs-markdown .hljs {font-size: 12px!important;}

}

#navigator { height:auto; overflow:hidden; *zoom:1;}
#navList { float:left; }
#navList li { display: inline; float: none; }

#div_digg {
  position: fixed;
  bottom: -13px;
  right: 40px;
  z-index: 9999;
}
#div_digg {
  float: right;
  margin-bottom: 10px;
  margin-right: 30px;
  font-size: 12px;
   125px;
  text-align: center;
  margin-top: 10px;
}

#under_post_news,#under_post_kb,#ad_t2,#ad_c1,#ad_c2,.c_ad_block{display:none !important;}

#cnblogs_post_body h2 {
    background: none repeat scroll 0 0 #45A9B6; /*#049FF1*/
    border-radius: 4px;
    clear: both;
    color: #FFFFFF;
    font-family: 'Microsoft Yahei';
    font-size: 20px;
    margin: 10px 0;
    padding: 6px 20px;
    text-align: left;
    box-shadow: 0 0 0 1px #45A9B6, 1px 1px 6px 1px rgba(10, 10, 0, 0.5);
}

a[title="站长统计"]{display:none;}

body{font-family: 微软雅黑, HelveticaNeue-Light, 'Helvetica Neue Light', 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size: 16px;}

此时还没有完成,因为少了meta里viewport的声明。

默认博客只有自定义css权限,自定义js等功能没有权限。需要发送邮件至contact@cnblogs.com联系管理员开发权限,原因可以按实说明,大概1天左右可以开通。会有邮件通知。

如果权限已开通,请在页首Html代码加上以下代码:

<meta name="viewport" content="width=device-width,initial-scale=1.0">

<script>
var meta = document.createElement('meta');
meta.setAttribute('name', 'viewport');
meta.setAttribute('content', 'initialwidth=device-width,initial-scale=1');
document.getElementsByTagName('head')[0].appendChild(meta);
</script>

这样就行了。

下面这句解决了每次打开时慢慢的才变成响应式的问题:

<meta name="viewport" content="initial-scale=1, maximum-scale=1">

自动生成目录

页脚Html代码加上:

<style>
#sideToolbar {
	position: fixed;
	bottom: 20px;
	right: 25px;
	 250px;
}
#sideToolbar ul,#sideToolbar ol{
	padding: 0px;
}
#sideToolbar li{
	list-style: none;
}
#sideCatalog{
	background-color:#fff;
	padding-bottom:10px;
	border-radius:5px;
}
#sideCatalog-sidebar {
	-moz-border-bottom-colors: none;
	-moz-border-left-colors: none;
	-moz-border-right-colors: none;
	-moz-border-top-colors: none;
	background-color: #eaeaea;
	border-color: -moz-use-text-color #eaeaea;
	border-image: none;
	border-left: 1px solid #eaeaea;
	border-right: 1px solid #eaeaea;
	border-style: none solid;
	border- 0 1px;
	height: 353px;
	left: 5px;
	position: absolute;
	top: 0;
	 0
}
#sideCatalog-catalog {
  height: 325px;
  padding-top: 18px;
  overflow-y: scroll;
  overflow-x: hidden;
  padding-left: 23px;
  position: relative;
}
#sideCatalog #sideCatalog-sidebar .sideCatalog-sidebar-top {
	cursor: pointer;
	top: 0
}
#sideCatalog #sideCatalog-sidebar .sideCatalog-sidebar-bottom {
	bottom: 0
}
#sideCatalog #sideCatalog-sidebar .sideCatalog-sidebar-top,#sideCatalog #sideCatalog-sidebar .sideCatalog-sidebar-bottom {
	background: url("https://images0.cnblogs.com/blog2015/294743/201503/111725133399017.gif") no-repeat scroll 0 -199px transparent;
	height: 10px;
	left: -5px;
	overflow: hidden;
	position: absolute;
	 10px
}
#sideCatalog li {
	margin: 0px;
	padding: 0 7px;
	text-align: left;
	position: relative;
	font-size:13px;
}
#sideCatalog li: hover {
	background-color: #f5f5f5
}
#sideCatalog-catalog ul .active {
	background-color: #f5f5f5
}
#sideCatalog-catalog .active a {
	color: #519cea
}
#sideCatalog-catalog a: hover {
	color: #519cea
}
#sideCatalog span: first-child {
	color: #999;
	font-family: Arial;
	font-size: 14px;
	font-weight: bold;
	padding-right: 5px
}
#sideCatalog li.h2Offset {
	padding-left: 45px;
	text-indent: -25px
}
#sideCatalog li.h3Offset {
	padding-left: 85px;
	text-indent: -50px
}
#sideCatalog a {
	text-decoration: none;
	color: #555;
	font-weight: bold;
	font-size:13px;
}
.sideCatalog-dot {
	background: url("https://images0.cnblogs.com/blog2015/294743/201503/111725133399017.gif") repeat scroll 0 -222px transparent;
	cursor: pointer;
	font-size: 12px;
	height: 10px;
	left: -20px;
	line-height: 12px;
	overflow: hidden;
	position: absolute;
	top: 4px;
	 6px
}
#sideCatalog .highlight .sideCatalog-dot {
	background: url("https://images0.cnblogs.com/blog2015/294743/201503/111725133399017.gif") no-repeat scroll -271px -38px transparent;
	height: 13px;
	left: -23px;
	top: 3px;
	 18px
}
#sideCatalogBtn {
	background: url("https://images0.cnblogs.com/blog2015/294743/201503/111725133399017.gif") no-repeat scroll 0 0 transparent;
	cursor: pointer;
	display: block;
	height: 45px;
	margin-bottom: 5px;
	margin-left: 5px;
	position: relative;
	 45px;
	margin-top: 10px;
	outline: 0
}
#sideCatalogBtn: hover {
	background: url("https://images0.cnblogs.com/blog2015/294743/201503/111725133399017.gif") no-repeat scroll -154px 0 transparent
}
.sideCatalogBtnDisable {
	background: url("https://images0.cnblogs.com/blog2015/294743/201503/111725133399017.gif") no-repeat scroll -104px 0 transparent !important
}
#sideToolbar-up {
	background: url("https://images0.cnblogs.com/blog2015/294743/201503/111725133399017.gif") no-repeat scroll -1px -62px transparent;
	border-radius: 2px;
	display: block;
	height: 45px;
	margin-left: 5px;
	 45px;
	outline: 0
}
#sideToolbar-up: hover {
	background: url("https://images0.cnblogs.com/blog2015/294743/201503/111725133399017.gif") no-repeat scroll -74px -62px transparent
}
</style>

<script type="text/javascript">

  var a = $(document);
  a.ready(function () {
    var b = $('#mainContent'),
        d = 'sideToolbar',
        e = 'sideCatalog',
        f = 'sideCatalog-catalog',
        g = 'sideCatalogBtn',
        h = 'sideToolbar-up',
        i = '<div id="sideToolbar"style="display:none;"><div class="sideCatalogBg"id="sideCatalog"><div id="sideCatalog-sidebar"><div class="sideCatalog-sidebar-top"></div><div class="sideCatalog-sidebar-bottom"></div></div><div id="sideCatalog-catalog"><ul class="nav"style="100%;zoom:1"></ul></div></div><a href="javascript:void(0);"id="sideCatalogBtn"class="sideCatalogBtnDisable"></a></div>',
        j = '',
        k = 200,
        l = 0,
        m = 0,
        n = 0,
        o, p = 113,
        q = true,
        r = true,
        s = b;
    if (s.length == 0) {
      return
    };
    b.append(i);
    o = s.find(':header');
    if (o.length > p) {
      r = false;
      var t = s.find('h2');
      var u = s.find('h3');
      if (t.length + u.length > p) {
        q = false
      }
    };

	if(o.length == 0) return;

    o.each(function (t) {
      var u = $(this),
            v = u[0];

      var title = u.text();
      var text = u.text();

      u.attr('id', 'autoid-' + l + '-' + m + '-' + n)
      //if (!u.attr('id')) {
      //    u.attr('id', 'autoid-' + l + '-' + m + '-' + n)
      //};
      if (v.localName === 'h2') {
        l++;
        m = 0;
        if (text.length > 22) text = text.substr(0, 22) + "...";
        j += '<li><span>' + l + '&nbsp&nbsp</span><a href="#' + u.attr('id') + '" title="' + title + '">' + text + '</a><span class="sideCatalog-dot"></span></li>';
      } else if (v.localName === 'h3') {
        m++;
        n = 0;
        if (q) {
          if (text.length > 18) text = text.substr(0, 18) + "...";
          j += '<li class="h2Offset"><span>' + l + '.' + m + '&nbsp&nbsp</span><a href="#' + u.attr('id') + '" title="' + title + '">' + text + '</a></li>';
        }
      } else if (v.localName === 'h4') {
        n++;
        if (r) {
          j += '<li class="h3Offset"><span>' + l + '.' + m + '.' + n + '&nbsp&nbsp</span><a href="#' + u.attr('id') + '" title="' + title + '">' + u.text() + '</a></li>';
        }
      }
    });
    $('#' + f + '>ul').html(j);
    b.data('spy', 'scroll');
    b.data('target', '.sideCatalogBg');

    $sideCatelog = $('#' + e);
    $('#' + g).on('click', function () {
      if ($(this).hasClass('sideCatalogBtnDisable')) {
        $sideCatelog.css('display', 'none')
      } else {
        $sideCatelog.css('display', '')
      };
      $(this).toggleClass('sideCatalogBtnDisable')
    });
$('#sideCatalogBtn').removeClass('sideCatalogBtnDisable')
 $sideCatelog.css('display', 'none');

    $sideToolbar = $('#' + d);
  $sideToolbar.css('display', 'block');


  });

</script>

<!--footer-->
<script>
addNag("PHP","http://www.cnblogs.com/52fhy/category/604746.html",3);
//addNag("Python","http://www.cnblogs.com/52fhy/category/765258.html",4);

function addNag(linkName,linkHref,linkLocation){
	//获得导航DOM对象
	var _navigator = document.getElementsByTagName("ul")[0];
	//创建导航无序列表中的li
	var _link = document.createElement("li");
	var _a = document.createElement("a");
	_a.class="menu";
	_a.href= linkHref;
	var _text = document.createTextNode(linkName);
	_a.appendChild(_text);
	_link.appendChild(_a);
	//添加至指定的位置
	var _lis = _navigator.getElementsByTagName("li");
	if(linkLocation > _lis.length && linkLocation > 0){
		_navigator.appendChild(_link);
	}else{
		_navigator.insertBefore(_link,_lis[linkLocation-1]);
	}
}
</script>
<!--/footer-->


<script src="http://s4.cnzz.com/z_stat.php?id=1258351730&web_id=1258351730"></script>
<!--
<script type="text/javascript" color="51,153,0" opacity="0.8" src="//github.atool.org/canvas-nest.min.js" async></script>
-->

侧边栏

<br/>
PHP攻城狮,喜欢技术与分享,主攻但不限于PHP。重点关注PHP、Golang、C/C++、Linux应用编程、Android、H5以及软件架构等领域。
<div  style="margin:5px 5px">
<img style="200px;" src="http://images2015.cnblogs.com/blog/663847/201703/663847-20170331215930477-1406562582.jpg">
</div>

</div>
欢迎关注公众号及时获取最新文章推送!
<br/>
<br/>
<hr>

Silence

博客皮肤

Custom

页面CSS

.cnblogs-markdown .hljs{display:block;color:#333;overflow-x:auto;background:#F2F4F5!important;border:none!important;font-family:Menlo, Monaco, Consolas,'Courier New', monospace,'Ubuntu Mono' !important;padding:1em!important;font-size:14px!important}.hljs-comment,.hljs-meta{color:#969896}.hljs-emphasis,.hljs-quote,.hljs-string,.hljs-strong,.hljs-template-variable,.hljs-variable{color:#df5000}.hljs-keyword,.hljs-selector-tag,.hljs-type{color:#a71d5d}.hljs-attribute,.hljs-bullet,.hljs-literal,.hljs-symbol{color:#0086b3}.hljs-name,.hljs-section{color:#63a35c}.hljs-tag{color:#333}.hljs-attr,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id,.hljs-selector-pseudo,.hljs-title{color:#795da3}.hljs-addition{color:#55a532;background-color:#eaffea}.hljs-deletion{color:#bd2c00;background-color:#ffecec}.hljs-link{text-decoration:underline}body{background:#fff;min-height:100%!important;color:#000001!important;font-family:PingFang SC,Hiragino Sans GB,Helvetica Neue,Microsoft Yahei,WenQuanYi Micro Hei,sans-serif !important}a{transition:all .3s ease!important}a:hover{color:#2D8CF0!important;text-decoration:none!important}#ad_c1,#ad_c2,#ad_t2,#author_profile,#blogCalendar,#blogTitle h2,#comment_form_container p:nth-of-type(3),#comments_pager_top,#green_channel,#homepage_top_pager,#sidebar_imagecategory,#sidebar_postarchive,#sidebar_recentcomments,#sidebar_recentposts,#sidebar_scorerank,#sidebar_search,#sidebar_shortcut,#sidebar_topcommentedposts,#tip_comment2,#under_post_kb,#under_post_news,.blogStats,.c_ad_block,.commentbox_title_left,.commentform p,.dayTitle{display:none}#home{100%}#header{960px;position:fixed;top:0;right:0;left:0;margin:0 auto;border-top:0;background:#fff;opacity:.95;border-bottom:1px #eef2f8 solid;padding-bottom:0;display:block;height:60px;z-index:941112}#header #blogTitle{position:relative;height:60px}#header #blogTitle h1{font-size:25px;font-family:Georgia;auto;margin-left:0;margin-top:12px;padding-left:15px}#header #blogTitle h1 a{color:#404040}#header #navigator{height:inherit;position:absolute;right:0;top:0;background-color:transparent;display:inline-block;z-index:999}#header #navList{height:inherit}#header #navList li{position:relative}#header #navList li:hover i{100%;left:0}#header #navList li #blog_nav_tags{display:none}#header #navList li i{0;height:4px;background-color:#2D8CF0;content:"";position:absolute;left:50%;bottom:0;transition:1s}#header #navList a:active,#header #navList a:link,#header #navList a:visited{font-size:16px;padding-top:0;border-right:0;color:#000001;display:block;font-weight:300;padding:20px 0;height:inherit;-webkit-transition:all .3s;transition:all .3s}#header #navList a:hover{background:0 0}#main{960px;margin:0 auto;min-height:750px;padding:70px 10px 0 10px;animation-name:fadeIn;animation-duration:1s;animation-iteration-count:1;-webkit-animation-name:fadeIn;-webkit-animation-duration:1s;-webkit-animation-iteration-count:1}#main #mainContent{background-color:transparent}#main #mainContent .forFlow{margin:0 auto;margin-left:0;max-960px}#sideBar{border-right:1px solid #eef2f8;font-weight:300;display:none;min-height:750px;padding:0}#sideBar #profile_block{margin-top:0;font-size:15px;padding-left:15px}#sideBar #profile_block #p_b_follow{margin-top:10px}#sideBar #profile_block a{color:#000001}.catListTitle{position:relative;text-align:left;margin-top:20px;padding-left:15px;font-size:20px;font-weight:300;border-bottom:none}.catListTitle::before{content:'♢';color:#000001;position:absolute;top:1px;left:-2px}#sidebar_categories li,#sidebar_toptags li{font-size:15px;height:40px;margin:0;padding-left:15px;padding-right:15px;line-height:42px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#sidebar_categories li a,#sidebar_toptags li a{color:#000001}#sidebar_categories li:active,#sidebar_categories li:link,#sidebar_categories li:visited,#sidebar_toptags li:active,#sidebar_toptags li:link,#sidebar_toptags li:visited{text-decoration:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#sidebar_categories li:hover,#sidebar_toptags li:hover{margin-left:10px;border-radius:5px;margin:0 5px;font-size:17px}#sidebar_topdiggedposts li,#sidebar_topviewedposts li{margin:12px 0;font-size:15px;padding-left:15px;padding-right:15px;text-align:justify}#sidebar_topdiggedposts li a:active,#sidebar_topdiggedposts li a:hover,#sidebar_topdiggedposts li a:link,#sidebar_topdiggedposts li a:visited,#sidebar_topviewedposts li a:active,#sidebar_topviewedposts li a:hover,#sidebar_topviewedposts li a:link,#sidebar_topviewedposts li a:visited{color:#000001}#taglist_title,.PostListTitle,.entrylistTitle,.myposts_title,.thumbTitle{padding-bottom:3px;padding-right:10px;100%;text-align:left;border-bottom:0!important;font-size:20px!important;font-weight:300;margin-top:15px}#myposts{margin-left:0}#myposts .PostList{font-size:13px;font-weight:300;border-bottom:1px solid #eef2f8;padding:6px 0 10px 0;margin-right:0}#myposts .pager:first-of-type{display:none}#myposts a:link,#myposts a:visited{color:#000001}#myposts .postDesc2{color:inherit}.day,.entrylistItem{auto;border-bottom:1px solid #eef2f8;padding:10px 0 15px 0;text-align:justify}.day .postSeparator,.entrylistItem .postSeparator{margin-top:15px;margin-bottom:25px;border-top:1px solid #eef2f8}.day .postTitle,.entrylist .entrylistPosttitle{font-size:20px;font-weight:300;font-family:inherit;padding-left:0;border-bottom:none}.day .postTitle a,.entrylist .entrylistPosttitle a{color:#000001}.day .postCon,.entrylist .entrylistPostSummary{font-size:16px;font-weight:300;font-family:inherit;padding-left:0}.day .postCon .c_b_p_desc img,.entrylist .entrylistPostSummary .c_b_p_desc img{height:100px;margin-left:10px}.day .postCon .c_b_p_desc a,.entrylist .entrylistPostSummary .c_b_p_desc a{border:1px solid;border-radius:3px;padding:2px 9px;font-size:13px;margin-top:10px;text-decoration:none;display:table;color:#000001;border-color:#000001}.day .postCon .c_b_p_desc a:after,.entrylist .entrylistPostSummary .c_b_p_desc a:after{content:' »'}.day .postCon .c_b_p_desc a:hover,.entrylist .entrylistPostSummary .c_b_p_desc a:hover{color:#2D8CF0!important;border:1px solid #2D8CF0}.day .postDesc,.entrylist .entrylistItemPostDesc,.post .postDesc{font-size:13px;font-weight:300;padding-right:0;color:#000001!important}.day .postDesc a,.entrylist .entrylistItemPostDesc a,.post .postDesc a{color:#000001}.entrylistDescription{text-align:left;color:#000001;font-size:13px}.post .postTitle{font-size:20px!important;font-weight:300!important;padding-left:15px!important;border-bottom:none!important}.post .postTitle a{color:#000001}.post .postBody{font-weight:300;font-size:16px;padding:5px 15px;line-height:1.7;color:#000001;border-bottom:1px solid #eef2f8}.post .postBody a:active,.post .postBody a:link,.post .postBody a:visited{color:#2D8CF0;text-decoration:none}.post .postBody h1{font-size:21px!important;color:#000001}.post .postBody h2{font-size:20px!important;color:#000001}.post .postBody h3{font-size:19px!important;color:#000001}.post .postBody h4{font-size:18px!important;color:#000001}.post .postBody h5{font-size:17px!important;color:#000001}.post .postBody h6{font-size:16px!important;color:#000001}.post .postBody p{margin:17px auto}.post .postBody hr{border-left:none;border-right:none;border-top:none;border-bottom:1px solid #eef2f8}.post .postBody blockquote{border:none;color:#000001;margin:20px 0;padding:0 0 0 10px;min-height:20px;background:0 0;border-left:4px solid #dde5f1}.post .postBody em{padding-right:3px}.post .postBody strong{margin:0 3px}.post .postBody img{max-930px!important;display:block;margin:30px auto;border-radius:3px}.post .postBody ol li,.post .postBody ul li{margin:3px 0;font-size:15px;color:#000001}.post .postBody ol li p,.post .postBody ul li p{margin:0!important}.post .postBody table{font-size:13px;border-collapse:collapse;border-spacing:0;empty-cells:show;border:1px solid #eef2f8;100%;margin-bottom:24px}.post .postBody table th{font-family:inherit;font-size:inherit;background:#f7f7f7!important;white-space:nowrap;font-weight:600;border:1px solid #eef2f8!important;padding:8px 16px!important}.post .postBody table td{border:1px solid #eef2f8!important;padding:8px 16px!important}.post .postBody h1 code,.post .postBody h2 code,.post .postBody h3 code,.post .postBody h4 code,.post .postBody h5 code,.post .postBody h6 code,.post .postBody li code,.post .postBody p code,.post .postBody table code{color:#000001;line-height:1;font-family:PingFang SC,Hiragino Sans GB,Helvetica Neue,Microsoft Yahei,WenQuanYi Micro Hei,sans-serif!important;vertical-align:middle;margin:0 3px;background:#f2f4f5!important;font-size:16px!important;padding:.2em .3em!important;border-radius:3px!important;border:1px solid #eee!important;}.post .postBody #BlogPostCategory{font-size:13px;margin-bottom:0}.post .postBody #BlogPostCategory a{margin-left:5px}.post .postBody #EntryTag{font-size:13px;color:#000001}.post .postBody #EntryTag a{color:#2D8CF0}.post .postBody #post_next_prev{font-size:13px}.cnblogs_code{background-color:#f2f4f5;padding-left:1em;padding-right:1em;border:none!important;border-radius:3px!important;font-family:Lucida Console,Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace!important}.cnblogs_code div{background-color:transparent;color:#656c73}.cnblogs_code img{margin:0!important}.cnblogs_code pre{color:#656c73;font-family:inherit!important}.cnblogs_code pre span{font-family:inherit!important;color:inherit!important}.cnblogs_code textarea{font-family:inherit!important;padding:5px;border:1px solid #3e4c42;color:#c5d4ef;background-color:#282c34}.cnblogs_code textarea:focus{outline:0}.cnblogs_code .code_img_closed,.cnblogs_code .code_img_opened{display:none!important}.cnblogs_code .cnblogs_code_toolbar{20px}.cnblogs_code .cnblogs_code_toolbar span{padding-right:0}.cnblogs_code .cnblogs_code_toolbar a:link img{background-color:transparent!important}.cnblogs_code .cnblogs_code_collapse{color:#656c73;border:1px solid #989fa6;border-radius:2px;background-color:transparent;display:inline-block;cursor:pointer;padding:5px 5px 2px 5px}.github-corner svg{fill:#2D8CF0}#footer{border-top:1px solid #eef2f8;font-weight:300}#footer div{margin:5px auto}#footer a{color:#000001}#footer:after{content:'❤';color:#ef6b6b;font-size:16px}.cnblogs-markdown pre{white-space:pre!important;position:relative!important}#taglist_main{margin-top:0}#taglist_main table{100%}#taglist_main table tr td{padding:5px 20px 5px 0}#taglist_main table tr td .small{display:none}#taglist_main table tr td a{display:inline-block;font-size:12px;line-height:1;padding:5px;margin:0;100%;text-align:center;border:1px solid #000001;border-radius:2px;color:#000001;background-color:transparent}#taglist_main table tr td a:hover{color:#2D8CF0!important;border:1px solid #2D8CF0;text-decoration:none}.topicListFooter{margin-right:0}#nav_next_page,.pager{margin-right:0;color:#000001}#nav_next_page a,.pager a{padding:3px 7px;border:1px solid #000001;border-radius:4px;font-family:Monospaced Number;margin:0 3px;text-decoration:none;color:inherit;transition:border .2s ease-in-out,color .2s ease-in-out}#nav_next_page a:hover,.pager a:hover{color:#2D8CF0;border:1px solid #2D8CF0}.pager span.current{padding:3px 7px;border:1px solid #2D8CF0;border-radius:4px;font-family:Monospaced Number;margin:0 3px;text-decoration:none;background-color:#2D8CF0}.esa-clipboard-button{font-size:12px;cursor:pointer;position:absolute;right:6px;top:6px;box-shadow:0 0 15px 0 rgba(0,0,0,.1);color:#5e6687;padding:0 6px;border-radius:5px}.esa-toolbar{position:fixed;display:grid;z-index:999;bottom:30px;right:30px}.esa-toolbar .esa-toolbar-contents,.esa-toolbar .esa-toolbar-follow,.esa-toolbar .esa-toolbar-gotop{height:45px;45px;font-weight:400;position:relative;outline:0;cursor:pointer;border:1px solid transparent;transition:color .2s linear,background-color .2s linear,border .2s linear,box-shadow .2s linear;margin-top:5px;border-color:#eef2f8;background-color:#fff;background-position:center;background-repeat:no-repeat}.esa-toolbar .esa-toolbar-contents .tips,.esa-toolbar .esa-toolbar-follow .tips,.esa-toolbar .esa-toolbar-gotop .tips{position:absolute;left:-60px;top:15px;display:none;color:#2D8CF0;font-size:12px}.esa-toolbar .esa-toolbar-contents:hover,.esa-toolbar .esa-toolbar-follow:hover,.esa-toolbar .esa-toolbar-gotop:hover{color:#2D8CF0;border-color:#2D8CF0}.esa-toolbar .esa-toolbar-gotop{display:none;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAYAAADE6YVjAAACL0lEQVRIS+3TwWvTUBwH8O/vJSLrFBURFPSkoIiCVz3IilObFA/aNR0yEEk6EXfxH1D0L5DdyroMHaJL1a1Ikw3H6kVBHHjyIKKgMEQmbOqsTpv8JOkmna4mvQyRvVv4/fL78L7vPcIKLFoBA6tIUyn/e3H1F+xjYB4B8EyGp53RTkxF2VLkneQLTieYBwmQ/cEMfgsJh41U8k0YFAnJW3YPAb2Afxv5CZj2gdAK8BQgjuia8uJvUCiSt+wrBFxaGOJ8WYeTsQr2kscTAG1k5g+eJLV1dySeN4IaIsxMpuXkQMjW4kFh55aW0/F4vOp/D9wZ2+N67gQB25h5RmJx/Gyn8nQ5aFmk17bXtn7mGyDSAoBh6ppiEBHXDzFvje3wpADaxcAcGAkjoz76HfoDyVkPNsj44QA4GDQzrukZ9WKjKK7fG99crX4vA9gP8FePhJpNKw/r+5cgfXft7cLFOIDdCxFdNjT1atjt6S8W12NeHgXoEAPzgEgZWqK0+N8vZMAqHfAAB6CtzOwBlDUyqhkGLNYt63HLJ8zaBLQxUCWQpmvKsF8PEHNotN0jt0igGBjfIHBKT6t+ZE0t/yxjc3yfQEcBdplEl5FWblOfZWcE+CZAEgMfSXC73pGcbGp6XXMuN7lG3vR+GKBkcGeIz1N+qDRIRF1RH1YUvFwuy6+nKyM1iGepluVMtytJ1rlU4l2UIVF6fOjVdOUCs3gZ+uKjDAzrWUXCElpS/3/i+gn3gM6tu0xSdwAAAABJRU5ErkJggg==)}.esa-toolbar .esa-toolbar-contents{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAYAAADE6YVjAAAAuUlEQVRIS2NkoANgpIMdDPSxZO6qbQeQffOf+X98SrD3w0WLdnL/5vi7lRo+ZZy7att/ZIMYGRi0k8K8rs1ctZufheH3B6pYMnv1dgdkg/5x/DmV7uv7bdWqVcwfGXltqWIJNQwhZAZ9Ip6QK6ghP4x8Mnfl1gaUJMzIODUpzOv1pG3b2Lk//6+kSnDRJZ/QxSfUCA5CZgyj1EXIq9SQp09w0aUUpk8+oUelRY2IJWQGfSKekCuoIQ8At39XNxqN1mQAAAAASUVORK5CYII=)}.esa-toolbar .esa-toolbar-follow{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAYAAADE6YVjAAAAsUlEQVRIS2NkIAHMXbU98D/D/zn/GRlTU0M91xGrlZFYhSB1c1Zu62RkZChj+M/QmxzuVUKs3lFLRoOLcFoZTV30ySdzV29zY2BgtGT494+ghf8ZGF0YGRmskXP8pG3b2Lm/MqQx/PsvjBGrTEz/Gf8xHmWcs3LrC0ZGRnHC0Y6kAqlYmbNyqx0jI+NBnPr/M/xgpKlPwDYzPiUYRMguHE3Co8E1WtQTzvPDJ5+Q2+4CADezs7EkSK8aAAAAAElFTkSuQmCC)}.esa-profile-avatar{margin-left:15px;margin-top:15px;border-radius:3px;200px}.esa-follow-button{z-index:999;display:none;position:fixed;bottom:30px;right:30px;height:45px;45px;font-weight:400;outline:0;cursor:pointer;border:1px solid transparent;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;font-size:12px;border-radius:50px;color:#515a6e;background-color:#fff;border-color:#dcdee2}.esa-follow-button:hover{color:#2D8CF0;border-color:#2D8CF0;background-color:#fff}.esa-mobile-menu{display:none;position:fixed;top:7px;right:15px;z-index:941113;font-size:1.5em;cursor:pointer;color:#7f7f7f}.esa-mobile-menu:after{content:'2630';font-size:1.5em;font-family:fontello}.esa-catalog{position:fixed;top:120px;right:1px;auto;height:auto;z-index:999999}.esa-catalog-title{cursor:move;padding-left:12px;100%;height:35px;line-height:36px;border-bottom:1px solid #eef2f8;font-size:12px;font-weight:600;color:#929aa2}.esa-catalog-title:before{content:'☲';margin-right:5px}.esa-catalog-close{position:absolute;right:15px;top:10px;cursor:pointer;color:#929aa2}.esa-catalog-contents{overflow:hidden;display:none;color:#000001;border:1px solid #eef2f8;min-150px;opacity:1;font-size:inherit;background-color:#fff;z-index:19941112}.esa-catalog-contents ul{padding:10px 15px;max-height:350px;overflow-y:auto}.esa-catalog-contents ul li{margin-top:5px;max-170px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;color:#929aa2}.esa-catalog-contents ul li code{font-family:inherit}.esa-catalog-contents ul li a:hover{color:#2D8CF0;text-decoration:none}.esa-catalog-contents ul li .level1{margin-left:0}.esa-catalog-contents ul li .level2{margin-left:10px}.esa-catalog-contents ul li .level3{margin-left:26px}.esa-anchor{opacity:0;-webkit-transition:opacity .3s ease;transition:opacity .3s ease;margin-left:8px}.esa-post-signature{padding:12px 24px 12px 30px;margin-top:15px;margin-left:5px;border-left-4px;font-size:15px;line-height:2;border-left-style:solid;background-color:#f8f8f8;position:relative;border-bottom-right-radius:2px;border-top-right-radius:2px;border-left-color:#2D8CF0;z-index:1}.esa-post-signature:before{content:"!";background-color:#2D8CF0;position:absolute;top:25px;left:-12px;color:#fff;20px;height:20px;border-radius:100%;text-align:center;line-height:20px;font-weight:700;font-size:14px}.esa-post-signature p{margin:0!important}.esa-post-signature a{color:#000001!important}.esa-layer{position:fixed;top:5px;text-align:center;line-height:25px;font-size:15px;font-family:inherit;100%;display:none;z-index:9999999}.esa-layer-content{position:relative;background:rgba(0,0,0,.7);max-250px;padding:3px 9px;font-size:13px;border-radius:5px;color:#FFF;display:inline-block}.esa-reward{display:none;position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);auto;height:auto;padding-bottom:30px;background:#fff;box-shadow:0 0 0 2000px rgba(0,0,0,.65);border-radius:4px;z-index:1000000}.esa-reward h2{text-align:center;font-size:20px;color:#000001;font-weight:400;margin:20px 0 10px 0}.esa-reward p{text-align:center}.esa-reward .esa-reward-container{margin:0 30px;text-align:center}.esa-reward .alipay,.esa-reward .wechat{position:relative;display:inline-block;200px;height:200px;padding:10px;border:2px solid #2D8CF0;border-radius:10px;box-sizing:border-box;margin:10px}.esa-reward .alipay:after,.esa-reward .wechat:after{content:'';position:absolute;left:30px;bottom:-10px;color:#000001;background:#fff;padding:0 10px;font-size:16px;auto;text-align:center}.esa-reward .alipay img,.esa-reward .wechat img{100%;170px;height:170px}.esa-reward .alipay:after{content:'支付宝,扫一扫'}.esa-reward .wechat:after{content:'微信,扫一扫'}.esa-reward-close{position:absolute;font-size:15px;color:#000001;top:7px;right:10px;cursor:pointer}.esa-reward-close:hover{transition:all .2s;color:#2D8CF0}.esa-reward-close:active{transition:all .2s;color:#2D8CF0}#div_digg{position:static;float:none;margin:75px auto;z-index:-1;370px}#div_digg .buryit,#div_digg .diggit,#div_digg .favorite,#div_digg .reward{background:#FFF;margin:0;display:inline-block;auto;height:32px;border-0;cursor:pointer;color:#fff;user-select:none;padding:0 10px;border-radius:5px;transition:color .2s linear,background-color .2s linear,border .2s linear,box-shadow .2s linear}#div_digg .favorite{background-color:#2db7f5;border-color:#2db7f5;margin:0 5px}#div_digg .favorite:hover{background-color:#57c5f7;border-color:#57c5f7}#div_digg .reward{background-color:#e13d13;border-color:#e13d13;margin:0 5px}#div_digg .reward:hover{background-color:#f16643;border-color:#f16643}#div_digg .diggit{background-color:#18b566;border-color:#18b566}#div_digg .diggit:hover{background-color:#47cb89;border-color:#47cb89}#div_digg .buryit{background-color:#f90;border-color:#f90}#div_digg .buryit:hover{background-color:#ffad33;border-color:#ffad33}#div_digg .buryit .burynum,#div_digg .diggit .diggnum,#div_digg .favorite .favoritenum,#div_digg .reward .rewardnum{color:snow;display:inline-block;font-size:15px;position:relative;top:5px;65px}#div_digg .favorite .favoritenum:before{content:'收藏';font-size:15px}#div_digg .reward .rewardnum:before{content:'赞赏';font-size:15px}#div_digg .diggit .diggnum:before{content:'推荐';font-size:15px;margin-right:5px}#div_digg .buryit .burynum:before{content:'反对';font-size:15px;margin-right:5px}.feedbackItem .feedbackListSubtitle{color:transparent}.feedbackItem .feedbackListSubtitle .sendMsg2This{background:0 0;padding-left:0;font-size:15px}.feedbackItem .feedbackListSubtitle .sendMsg2This::before{content:'✉️'}.feedbackItem a{color:#000001}.feedbackItem .louzhu{background:#2D8CF0!important;color:#fff;border-radius:2px;margin:0 2px;padding:0 6px 2px 6px!important}.feedbackItem .comment_date{color:#666}.feedbackItem .comment_quote{border:1px dashed #2D8CF0;border-radius:3px}#comment_nav{visibility:hidden}.feedbackCon{background:0 0;padding:10px 0 10px 0;border-bottom:1px solid #eef2f8}.feedbackCon .esa-comment-avatar{float:left;margin-right:10px}.feedbackCon .esa-comment-avatar img{border-radius:50%;transition:all .5s ease-out;-webkit-transition:all .6s ease-out;-moz-transition:all .5s ease-out;-ms-transition:all .5s ease-out;-o-transition:all .5s ease-out}.feedbackCon .esa-comment-avatar img:hover{-webkit-transform:rotateZ(360deg);-moz-transform:rotateZ(360deg);-ms-transform:rotateZ(360deg);-o-transform:rotateZ(360deg);transform:rotateZ(360deg)}.feedbackCon .blog_comment_body{border-radius:3px;padding:8px;margin-top:5px;margin-right:10px;margin-left:6px;font-size:13px;display:block;color:#434b69;background-color:rgba(193,193,193,.2);auto}.feedbackCon .blog_comment_body a{color:#2D8CF0}.feedbackCon .blog_comment_body img{border-radius:3px}.feedbackCon .comment_vote{margin-top:12px}.feedback_area_title{border-bottom:1px solid #eef2f8;margin-bottom:15px;font-size:13px;font-weight:300;padding-left:0;padding-bottom:5px}.commentform #commentform_title{background-image:none;padding-left:0;font-size:20px}.commentform #tip_comment{color:#f37f7f!important;margin:15px 0;display:block}.commentform .commentbox_title .commentbox_title_right{height:30px;float:left}.commentform .commentbox_title .comment_icon{16px;height:16px;border:1px solid #eef2f8;border-radius:3px;background-color:#fff;padding:3px;cursor:pointer}.commentform .comment_textarea{100%!important;height:200px!important;border:1px solid #eef2f8;border-radius:6px;padding:5px;font-family:inherit;font-size:15px;resize:none;box-sizing:border-box;background-color:transparent;color:#000001}.commentform .comment_textarea:focus{outline:0}.commentform .comment_textarea:hover{border-color:#2D8CF0}.commentform #commentbox_opt{display:block}.commentform #commentbox_opt a{color:#000001}.commentform #btn_comment_submit{auto;height:auto;border-0;cursor:pointer;color:#fff;background-color:#2D8CF0;border-color:#2D8CF0;user-select:none;padding:5px 20px;font-size:12px;border-radius:5px;transition:color .2s linear,background-color .2s linear,border .2s linear,box-shadow .2s linear}.commentform #btn_comment_submit:hover{opacity:.7}.commentform .comment_my_posted>img{display:none}.commentform .comment_my_posted>a b{font-size:16px;font-weight:300}.commentform .bq_post_comment{margin-top:5px;font-size:13px;display:block;color:#434b69;background-color:rgba(193,193,193,.2);border:none;border-radius:3px}.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}::-webkit-scrollbar{3px;height:3px}::-webkit-scrollbar-thumb{border-radius:1px;box-shadow:inset 0 0 5px #000001;background:#000001}::-webkit-scrollbar-track{background:0 0;border-radius:1px}::-moz-selection,::selection{color:#2D8CF0}@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@media screen and (min-768px) and (max-980px){#blog-comments-placeholder,#comment_form{padding:10px;margin-left:0}}@media only screen and (max-767px){#home{font-size:12px!important}#mainContent .forFlow{padding-top:15px}#sideBar,.esa-catalog,.postDesc{display:none}.postBody{padding:0!important}#main{margin-top:60px;padding:0 15px!important}#topics .postTitle{padding-left:0!important;padding-top:10px}#cnblogs_post_body table{display:table!important}#cnblogs_post_body img{100%;max-none!important}#comment_nav,#commentbox_main{margin:0}#comment_form{padding:5px;margin-left:0}.esa-mobile-menu{display:block}.forFlow{margin-right:0;margin-left:0!important}#header{auto}#header #navigator{display:none;100%;margin-top:60px}#navList{inherit}#navList li{float:none}#navList li #blog_nav_tags{display:block!important}#navList a:active,#navList a:link,#navList a:visited{100%;background-color:#2c3e50;color:#fff!important;padding:15px 0}#navList a:hover{color:#2D8CF0;background-color:#2c3e50!important}.feedbackItem .feedbackManage{auto}.github-corner{display:none}}@media only screen and (max-410px){#div_digg{display:grid;100%}#div_digg .buryit,#div_digg .diggit,#div_digg .favorite,#div_digg .reward{margin:5px 0}}


h1 .postTitle2{font-size: 26px;line-height: 180%;margin-top: 15px;margin-bottom: 20px;font-family: 'Trebuchet MS', Arial, 'Lucida Grande',Verdana, Lucida, Helvetica, sans-serif;}}
.esa-catalog-contents ul li { color: #333;}
#cnblogs_post_body h2 {border-bottom: 1px solid rgba(0,154,97,0.25); padding-bottom: 1px;   }
.c_b_p_desc {color: #888;font-size: 0.9em;}
/*#navigator  ul li:first-child{display:none;}*/
#blog_nav_myhome,#blog_nav_contact,#blog_nav_rss{display:none !important;}
.catListTitle{font-weight:600;}
.post .postBody p code{color: #c7254e;background-color: #f9f2f4; border-radius: 4px;;}
.post .postBody a:active, .post .postBody a:link, .post .postBody a:visited {color: #009a61; text-decoration: none;}
.post .postBody p { line-height: 180%;}

a[title="站长统计"]{display:none;}
body{font-family: 微软雅黑, HelveticaNeue-Light, 'Helvetica Neue Light', 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size: 16px;}
/*#header{ background-color: #F5F5D9;}*/

@media (max-900px) {
    #cnblogs_post_body img{100% ;}
    .cnblogs_code_copy img{auto !important;}
    .cnblogs-markdown .hljs {font-size: 12px!important;}
    .post .postBody img { max- 100% !important; }
}

侧边栏

<br/>
PHP攻城狮,喜欢技术与分享,主攻但不限于PHP。重点关注PHP、Golang、C/C++、Linux应用编程、Android、H5以及软件架构等领域。


</div>
欢迎关注公众号及时获取最新文章推送!
<br/>
<br/>

<script>
var googletag = {};
googletag.length = 0;
googletag.cmd = {};
googletag.cmd.push = function(){};
</script>

页脚

<script>
addTag("PHP","http://www.cnblogs.com/52fhy/category/604746.html",5);
addTag("搜索","https://zzk.cnblogs.com/s/blogpost?w=blog%3A52fhy%20%20php",6);
addTag("关于我","https://www.cnblogs.com/52fhy/p/3969826.html",7);
function addTag(linkName,linkHref,linkLocation){
    //获得导航DOM对象
    var _navigator = document.getElementsByTagName("ul")[0];
    //创建导航无序列表中的li
    var _link = document.createElement("li");
    var _a = document.createElement("a");
    _a.class="menu";
    _a.href= linkHref;
    var _text = document.createTextNode(linkName);
    _a.appendChild(_text);
    _link.appendChild(_a);
    //添加至指定的位置
    var _lis = _navigator.getElementsByTagName("li");
    if(linkLocation > _lis.length && linkLocation > 0){
        _navigator.appendChild(_link);
    }else{
        _navigator.insertBefore(_link,_lis[linkLocation-1]);
    }
}

</script>


<script src="https://blog-static.cnblogs.com/files/52fhy/silence.min.js"></script>
<script type="text/javascript">
    $.silence({
        profile: {
            enable: true,
            avatar: 'https://images2015.cnblogs.com/blog/663847/201703/663847-20170331215930477-1406562582.jpg',
            favicon: 'https://files.cnblogs.com/files/52fhy/favicon-20190601030507728.ico',
        },
        catalog: {
            enable: false,
            move: true,
            index: true,
            level1: 'h2',
            level2: 'h3',
            level3: 'h4',
        },
        signature: {
            enable: true,
            home: 'http://blog.esofar.cn',
            license: 'CC BY 4.0',
            link: 'https://creativecommons.org/licenses/by/4.0'
        },
        reward: {
            enable: false,
            title: 'Buy Me A Coffee',
            wechat: 'https://images.cnblogs.com/cnblogs_com/esofar/972540/o_wechat.png',
            alipay: 'https://images.cnblogs.com/cnblogs_com/esofar/972540/o_alipay.png'
        },
        github: {
            enable: true,
            color: '#fff',
            fill: null,
            link: 'https://github.com/52fhy/'
        }
    });
</script>



<style>
#sideToolbar {
    position: fixed;
    bottom: 30px;
    right: 30px;
     180px;
}
#sideToolbar ul,#sideToolbar ol{
    padding: 0px;
}
#sideToolbar li{
    list-style: none;
}
#sideCatalog{
    background-color:#fff;
    padding-bottom:10px;
    border-radius:5px;
}
#sideCatalog-sidebar {
    -moz-border-bottom-colors: none;
    -moz-border-left-colors: none;
    -moz-border-right-colors: none;
    -moz-border-top-colors: none;
    background-color: #eaeaea;
    border-color: -moz-use-text-color #eaeaea;
    border-image: none;
    border-left: 1px solid #eaeaea;
    border-right: 1px solid #eaeaea;
    border-style: none solid;
    border- 0 1px;
    height: 353px;
    left: 5px;
    position: absolute;
    top: 0;
     0
}
#sideCatalog-catalog {
  height: 325px;
  padding-top: 18px;
  overflow-y: scroll;
  overflow-x: hidden;
  padding-left: 23px;
  position: relative;
}
#sideCatalog #sideCatalog-sidebar .sideCatalog-sidebar-top {
    cursor: pointer;
    top: 0
}
#sideCatalog #sideCatalog-sidebar .sideCatalog-sidebar-bottom {
    bottom: 0
}
#sideCatalog #sideCatalog-sidebar .sideCatalog-sidebar-top,#sideCatalog #sideCatalog-sidebar .sideCatalog-sidebar-bottom {
    background: url("https://images0.cnblogs.com/blog2015/294743/201503/111725133399017.gif") no-repeat scroll 0 -199px transparent;
    height: 10px;
    left: -5px;
    overflow: hidden;
    position: absolute;
     10px
}
#sideCatalog li {
    margin: 0px;
    padding: 0 7px;
    text-align: left;
    position: relative;
    font-size:13px;
}
#sideCatalog li: hover {
    background-color: #f5f5f5
}
#sideCatalog-catalog ul .active {
    background-color: #f5f5f5
}
#sideCatalog-catalog .active a {
    color: #519cea
}
#sideCatalog-catalog a: hover {
    color: #519cea
}
#sideCatalog span: first-child {
    color: #999;
    font-family: Arial;
    font-size: 14px;
    font-weight: bold;
    padding-right: 5px
}
#sideCatalog li.h2Offset {
    padding-left: 45px;
    text-indent: -25px
}
#sideCatalog li.h3Offset {
    padding-left: 85px;
    text-indent: -50px
}
#sideCatalog a {
    text-decoration: none;
    color: #555;
    font-size:12px;
}
.sideCatalog-dot {
    background: url("https://images0.cnblogs.com/blog2015/294743/201503/111725133399017.gif") repeat scroll 0 -222px transparent;
    cursor: pointer;
    font-size: 12px;
    height: 10px;
    left: -20px;
    line-height: 12px;
    overflow: hidden;
    position: absolute;
    top: 4px;
     6px
}
#sideCatalog .highlight .sideCatalog-dot {
    background: url("https://images0.cnblogs.com/blog2015/294743/201503/111725133399017.gif") no-repeat scroll -271px -38px transparent;
    height: 13px;
    left: -23px;
    top: 3px;
     18px
}
#sideCatalogBtn {
    background: url("https://images0.cnblogs.com/blog2015/294743/201503/111725133399017.gif") no-repeat scroll 0 0 transparent;
    cursor: pointer;
    display: block;
    height: 45px;
    margin-bottom: 5px;
    margin-left: 5px;
    position: relative;
     45px;
    margin-top: 10px;
    outline: 0
}
#sideCatalogBtn: hover {
    background: url("https://images0.cnblogs.com/blog2015/294743/201503/111725133399017.gif") no-repeat scroll -154px 0 transparent
}
.sideCatalogBtnDisable {
    background: url("https://images0.cnblogs.com/blog2015/294743/201503/111725133399017.gif") no-repeat scroll -104px 0 transparent !important
}
#sideToolbar-up {
    background: url("https://images0.cnblogs.com/blog2015/294743/201503/111725133399017.gif") no-repeat scroll -1px -62px transparent;
    border-radius: 2px;
    display: block;
    height: 45px;
    margin-left: 5px;
     45px;
    outline: 0
}
#sideToolbar-up: hover {
    background: url("https://images0.cnblogs.com/blog2015/294743/201503/111725133399017.gif") no-repeat scroll -74px -62px transparent
}
</style>

<script type="text/javascript">

  var a = $(document);
  a.ready(function () {
    var b = $('#mainContent'),
        d = 'sideToolbar',
        e = 'sideCatalog',
        f = 'sideCatalog-catalog',
        g = 'sideCatalogBtn',
        h = 'sideToolbar-up',
        i = '<div id="sideToolbar"style="display:none;"><div class="sideCatalogBg"id="sideCatalog"><div id="sideCatalog-sidebar"><div class="sideCatalog-sidebar-top"></div><div class="sideCatalog-sidebar-bottom"></div></div><div id="sideCatalog-catalog"><ul class="nav"style="100%;zoom:1"></ul></div></div><a href="javascript:void(0);"id="sideCatalogBtn"class="sideCatalogBtnDisable"></a></div>',
        j = '',
        k = 200,
        l = 0,
        m = 0,
        n = 0,
        o, p = 113,
        q = true,
        r = true,
        s = b;
    if (s.length == 0) {
      return
    };
    b.append(i);
    o = s.find(':header');
    if (o.length > p) {
      r = false;
      var t = s.find('h2');
      var u = s.find('h3');
      if (t.length + u.length > p) {
        q = false
      }
    };

    if(o.length == 0) return;

    o.each(function (t) {
      var u = $(this),
            v = u[0];

      var title = u.text();
      var text = u.text();

      u.attr('id', 'autoid-' + l + '-' + m + '-' + n)
      //if (!u.attr('id')) {
      //    u.attr('id', 'autoid-' + l + '-' + m + '-' + n)
      //};
      if (v.localName === 'h2') {
        l++;
        m = 0;
        if (text.length > 22) text = text.substr(0, 22) + "...";
        j += '<li><span>' + l + '&nbsp&nbsp</span><a href="#' + u.attr('id') + '" title="' + title + '">' + text + '</a><span class="sideCatalog-dot"></span></li>';
      } else if (v.localName === 'h3') {
        m++;
        n = 0;
        if (q) {
          if (text.length > 18) text = text.substr(0, 18) + "...";
          j += '<li class="h2Offset"><span>' + l + '.' + m + '&nbsp&nbsp</span><a href="#' + u.attr('id') + '" title="' + title + '">' + text + '</a></li>';
        }
      } else if (v.localName === 'h4') {
        n++;
        if (r) {
          j += '<li class="h3Offset"><span>' + l + '.' + m + '.' + n + '&nbsp&nbsp</span><a href="#' + u.attr('id') + '" title="' + title + '">' + u.text() + '</a></li>';
        }
      }
    });
    $('#' + f + '>ul').html(j);
    b.data('spy', 'scroll');
    b.data('target', '.sideCatalogBg');

    $sideCatelog = $('#' + e);
    $('#' + g).on('click', function () {
      if ($(this).hasClass('sideCatalogBtnDisable')) {
        $sideCatelog.css('display', 'none')
      } else {
        $sideCatelog.css('display', '')
      };
      $(this).toggleClass('sideCatalogBtnDisable')
    });
$('#sideCatalogBtn').removeClass('sideCatalogBtnDisable')
 $sideCatelog.css('display', 'none');

    $sideToolbar = $('#' + d);
  $sideToolbar.css('display', 'block');


  });

</script>

<script src="http://s4.cnzz.com/z_stat.php?id=1258351730&web_id=1258351730"></script>




<script type="text/javascript">
/* 
var a_idx = 0;
jQuery(document).ready(function($) {
    $("body").click(function(e) {
        var a = new Array("❤飞鸿影的博客❤", "❤亲,记得点击底部收藏按钮哦❤", "❤万水千山总是情,打赏一包辣条行不行~❤", "❤欢迎关注公众号飞鸿影的博客(fhyblog)❤", "❤博主都快饿的写不下去了/(ㄒoㄒ)/~~,看完记得打赏博主哦❤", "❤一入IT深似海,从此回头皆路人❤", "❤❤❤");
        var $i = $("<span></span>").text(a[a_idx]);
        a_idx = (a_idx + 1) % a.length;
        var x = e.pageX,
        y = e.pageY;
        $i.css({
            "z-index": 999999999999999999999999,
            "top": y - 20,
            "left": x,
            "position": "absolute",
            "font-weight": "bold",
            "color": "rgb("+~~(255*Math.random())+","+~~(255*Math.random())+","+~~(255*Math.random())+")"
        });
        $("body").append($i);
        $i.animate({
            "top": y - 180,
            "opacity": 0
        },
        3500,
        function() {
            $i.remove();
        });
    });
});
*/
</script>

参考:
1、【写漂亮的博客】让我们的博客更加漂亮,让我们的博客支持响应式布局! - 叶小钗 - 博客园
http://www.cnblogs.com/yexiaochai/archive/2013/05/27/3101311.html
2、自定义博客园皮肤:暗色流体响应式布局 - JiayangShen - 博客园
http://www.cnblogs.com/shn11160/archive/2013/03/23/2977123.html

原文地址:https://www.cnblogs.com/52fhy/p/5110907.html