1 #header{display:none;} /* 將預設的導航頭遮蔽掉,這樣才能把自己的導航欄加上去 */
2
3
4 /* 定製自己導航欄的樣式 */
5 #shwtop ul {
6 margin: 0px;
7 padding: 0;
8 list-style-type: none; /*去除li前的標註*/
9 background-color: #333;
10 overflow: hidden; /*隱藏溢位的部分,保持一行*/
11 }
12 #shwtop li {
13 float: left; /*左浮動*/
14 }
15 #shwtop li a, .dropbtn {
16 display: inline-block; /*設定成塊*/
17 color: white;
18 text-align: center;
19 text-decoration: none;
20 padding: 14px 16px;
21 }
22 /*滑鼠移上去,改變背景顏色*/
23 #shwtop li a:hover, .dropdown:hover .dropbtn {
24 /* 當然顏色你可以自己改成自己喜歡的,我還是挺喜歡藍色的 */
25 background-color: blue;
26 }
27 #shwtop .dropdown {
28 /*
29 display:inline-block將物件呈遞為內聯物件,
30 但是物件的內容作為塊物件呈遞。
31 旁邊的內聯物件會被呈遞在同一行內,允許空格。
32 */
33 display: inline-block;
34 }
35 #shwtop .dropdown-content {
36 display: none;
37 position: absolute;
38 background-color: #f9f9f9;
39 min-width: 150px;
40 box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
41 }
42 #shwtop .dropdown-content a {
43 display: block;
44 color: black;
45 padding: 8px 10px;
46 text-decoration:none;
47 }
48 #shwtop .dropdown-content a:hover {
49 background-color: #a1a1a1;
50 }
51 #shwtop .dropdown:hover .dropdown-content{
52 display: block;
53 }
54
55 /* 定製生成部落格目錄的CSS樣式 */
56 #uprightsideBar{
57 font-size:15px;
58 font-family:Arial, Helvetica, sans-serif;
59 text-align:left;
60 position:fixed;
61 /*
62 將div的位置固定到距離top:150px,right:0px的位置,
63 這樣div就會處在最右邊的位置,距離頂部150px,
64 當然這兩個值你可以自己改。
65 */
66 top:150px;
67 right:10px;
68 width: auto;
69 height: auto;
70 }
71 #sideBarTab{
72 float:left;
73 width:25px;
74 box-shadow: 0 0 8px #877788;
75 border:1px solid #00DDC00;
76 border-right:none;
77 text-align:center;
78 background:rgb(0, 220, 0);
79 }
80 #sideBarContents{
81 float:left;
82 overflow:auto;
83 overflow-x:hidden;!important;
84 width:200px;
85 min-height:101px;
86 max-height:460px;
87 border:1px solid #e5e5e5;
88 border-right:none;
89 background:#ffffff;
90 }
91 #sideBarContents dl{
92 margin:0;
93 padding:0;
94 }
95 #sideBarContents dt{
96 margin-top:5px;
97 margin-left:5px;
98 }
99 #sideBarContents dd, dt {
100 cursor: pointer;
101 }
102 #sideBarContents dd:hover, dt:hover {
103 color:#A7995A;
104 }
105 #sideBarContents dd{
106 margin-left:20px;
107 }
108
109 /* 快速返回頂部 */
110 /* 定製返回頂部按鍵 */
111 #toTop {
112 background: url(http://images.cnblogs.com/cnblogs_com/shwee/1218109/o_toTop.bmp) no-repeat 0px top;
113 width: 57px;
114 height: 57px;
115 overflow: hidden;
116 position: fixed;
117 right: 20px;
118 bottom: 20px;
119 cursor: pointer;
120 }
121
122 /* 定製頁面擴大按鍵 */
123 #divExpandViewArea{
124 position: fixed;
125 color: white;
126 padding: 10px 10px;
127 left: 0px;
128 top: 400px;
129 cursor: pointer;
130 opacity: 0.9;
131 background-color: #68228B;
132 }
133 /* 定製頁面縮小按鍵 */
134 #divCollapseViewArea{
135 position: fixed;
136 color: white;
137 padding: 10px 10px;
138 left: 0px;
139 top: 445px;
140 cursor: pointer;
141 opacity: 0.9;
142 background-color: #68228B;
143 }
144
145 #main_container{
146 margin-left: 40px;
147 margin-right:40px;
148 }
149
150 /* 定製左側隨筆分類上下項之間的間距,左側隨筆分類顯示有多少項,你就在後面增加多少項 */
151 #CatList_LinkList_0_Link_0{
152 }
153 #CatList_LinkList_0_Link_1{
154 margin-top:10px;
155 }
156 #CatList_LinkList_0_Link_2{
157 margin-top:10px;
158 }
159 #CatList_LinkList_0_Link_3{
160 margin-top:10px;
161 }
162 #CatList_LinkList_0_Link_4{
163 margin-top:10px;
164 }
165 #CatList_LinkList_0_Link_5{
166 margin-top:10px;
167 }
168 #CatList_LinkList_0_Link_6{
169 margin-top:10px;
170 }
171 #CatList_LinkList_0_Link_7{
172 margin-top:10px;
173 }
174 #CatList_LinkList_0_Link_8{
175 margin-top:10px;
176 }
177
178 /* 字型 */
179 /*文章內容詳情頁面的標h2、h3的樣式*/
180 #cnblogs_post_body h2 {
181 background: #2B6695;
182 border-radius: 6px 6px 6px 6px;
183 box-shadow: 0 0 0 1px #5F5A4B, 1px 1px 6px 1px rgba(10, 10, 0, 0.5);
184 color: #FFFFFF;
185 font-family: "微軟雅黑" , "宋體" , "黑體" ,Arial;
186 font-size: 17px;
187 font-weight: bold;
188 height: 25px;
189 line-height: 25px;
190 margin: 18px 0 !important;
191 padding: 8px 0 5px 5px;
192 text-shadow: 2px 2px 3px #222222;
193 }
194 #cnblogs_post_body h3 {
195 background: #2B6600;
196 border-radius: 6px 6px 6px 6px;
197 box-shadow: 0 0 0 1px #5F5A4B, 1px 1px 6px 1px rgba(10, 10, 0, 0.5);
198 color: #eb3223;
199 font-family: "微軟雅黑" , "宋體" , "黑體" ,Arial;
200 font-size: 13px;
201 font-weight: bold;
202 height: 24px;
203 line-height: 23px;
204 margin: 12px 0 !important;
205 padding: 5px 0 5px 10px;
206 text-shadow: 2px 2px 3px #222222;
207 }
208
209 /* 定製部落格背景圖片,url裡面是你的圖片位置資訊 */
210 body {
211 background-color: #efefef;
212 background-image:url(https://images.cnblogs.com/cnblogs_com/blogs/677960/galleries/2037550/o_210928085530hh.png);
213 background-repeat: no-repeat;
214 background-attachment: fixed;
215 background-position: center 0;
216 background-size: cover;
217 padding-top:0px;
218 }
219
220 /*新增複製按鈕*/
221 .cnblogs-markdown pre {
222 position: relative;
223 }
224 .cnblogs-markdown pre > span {
225 position: absolute;
226 top: 0;
227 right: 0;
228 border-radius: 2px;
229 padding: 0 10px;
230 font-size: 12px;
231 background: rgba(0, 0, 0, 0.4);
232 color: #fff;
233 cursor: pointer;
234 display:none;
235 }
236 .cnblogs-markdown pre:hover > span {
237 display:block;
238 }
239 .cnblogs-markdown pre > .copyed {
240 background: #67c23a;
241 }

頁面CSS

 1 <!-- 新增公告欄圖片並指向首頁連結 -->
2 <div align="center">
3 <a href="http://www.cnblogs.com/RankFan/">
4 <img src="https://pic.cnblogs.com/avatar/2355125/20210411202630.png"></a>
5 </div>
6 <center>
7 <p class="gonggao"><a style="color: blue;font-weight: bold;" href="https://www.cnblogs.com/RankFan/p/Bayesian_VAR.html">我的部落格目錄結構</a></p>
8 <p class="wenzi">花有重開日,人無再少年</p>
9
10 <p>-------------------------------</p>
11 </center>
12
13 <!-- 為頁面新增愛心特效 -->
14 <script type="text/javascript">
15
16 (function(window,document,undefined){
17 var hearts = [];
18
19 window.requestAnimationFrame = (function(){
20 return window.requestAnimationFrame ||
21 window.webkitRequestAnimationFrame ||
22 window.mozRequestAnimationFrame ||
23 window.oRequestAnimationFrame ||
24 window.msRequestAnimationFrame ||
25 function (callback){
26 setTimeout(callback,1000/60);
27 }
28 })();
29
30 init();
31
32 function init(){
33 css(".heart{width: 10px;height: 10px;position: fixed;background: #f00;transform: rotate(45deg);-webkit-transform: rotate(45deg);-moz-transform: rotate(45deg);}.heart:after,.heart:before{content: '';width: inherit;height: inherit;background: inherit;border-radius: 50%;-webkit-border-radius: 50%;-moz-border-radius: 50%;position: absolute;}.heart:after{top: -5px;}.heart:before{left: -5px;}");
34 attachEvent();
35 gameloop();
36 }
37
38 function gameloop(){
39 for(var i=0;i<hearts.length;i++){
40 if(hearts[i].alpha <=0){
41 document.body.removeChild(hearts[i].el);
42 hearts.splice(i,1);
43 continue;
44 }
45
46 hearts[i].y--;
47 hearts[i].scale += 0.004;
48 hearts[i].alpha -= 0.013;
49 hearts[i].el.style.cssText = "left:"+hearts[i].x+"px;top:"+hearts[i].y+"px;opacity:"+hearts[i].alpha+";transform:scale("+hearts[i].scale+","+hearts[i].scale+") rotate(45deg);background:"+hearts[i].color;
50 }
51
52 requestAnimationFrame(gameloop);
53 }
54
55 function attachEvent(){
56 var old = typeof window.onclick==="function" && window.onclick;
57 window.onclick = function(event){
58 old && old();
59 createHeart(event);
60 }
61 }
62
63 function createHeart(event){
64 var d = document.createElement("div");
65 d.className = "heart";
66 hearts.push({
67 el : d,
68 x : event.clientX - 5,
69 y : event.clientY - 5,
70 scale : 1,
71 alpha : 1,
72 color : randomColor()
73 });
74
75 document.body.appendChild(d);
76 }
77
78 function css(css){
79 var style = document.createElement("style");
80 style.type="text/css";
81 try{
82 style.appendChild(document.createTextNode(css));
83 }
84 catch(ex){
85 style.styleSheet.cssText = css;
86 }
87
88 document.getElementsByTagName('head')[0].appendChild(style);
89 }
90
91 function randomColor(){
92 return "rgb("+(~~(Math.random()*255))+","+(~~(Math.random()*255))+","+(~~(Math.random()*255))+")";
93 }
94
95 })(window,document);
96 </script>

側邊欄

<!-- #034fd8 騰訊藍 -->
<p style="text-align: margin-left;font-size:35px;margin-bottom:10px;margin-top:20px;opacity: 0.8;color:white">
<font>歡迎來到RankFan的Blogs</font></p> <!-- 部落格頁面腳新增Github連結或其他連結 -->
<!-- 頁面左上角 -->
<a href="https://RankXiaoLong.github.io/" title="我的站點" target="_Blank" class="github-corner" aria-label="View source on Github"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#64CEAA; color:#fff; position: absolute; top: 0; border: 0; left: 0; transform: scale(-1, 1);" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.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)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style>
<!-- 頁面右上角 -->
<a href="https://github.com/RankXiaoLong" title="我的github地址" target="_Blank" class="github-corner" aria-label="View source on Github">
<svg width="80" height="80" viewBox="0 0 250 250" style="fill:#FD6C6C; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true">
<path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path>
<path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.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)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style> <!-- 建立新的導航欄,內容可更改為你自己的-->
<div id="shwtop" >
<ul style="margin-left:40px;margin-right: 40px;" class="test11" >
<div class="dropdown">
<a href="https://www.cnblogs.com/" target="_Blank" class="dropbtn"><span>部落格園首頁</span></a>
<div class="dropdown-content"> </div>
</div> <div class="dropdown">
<a href="http://www.cnblogs.com/RankFan/" target="_Blank" class="dropbtn"><span>我的首頁</span></a>
<div class="dropdown-content"> </div>
</div> <div class="dropdown">
<a href="https://www.cnblogs.com/RankFan/category/1963292.html" target="_Blank" class="dropbtn">Python雜記</a>
<div class="dropdown-content"> </div>
</div> <div class="dropdown">
<a href="https://www.cnblogs.com/RankFan/category/1967093.html" target="_Blank" class="dropbtn">Python視覺化</a>
<div class="dropdown-content"> </div>
</div> <div class="dropdown">
<a href="https://www.cnblogs.com/RankFan/category/1966284.html" target="_Blank" class="dropbtn">機器學習</a>
<div class="dropdown-content"> </div>
</div> <div class="dropdown">
<a href="https://www.cnblogs.com/RankFan/category/1959946.html" target="_Blank" class="dropbtn">狀態空間模型</a>
<div class="dropdown-content"> </div>
</div> <div class="dropdown">
<a href="https://www.cnblogs.com/RankFan/category/1997717.html" target="_Blank" class="dropbtn">LaTeX 記事本</a>
<div class="dropdown-content"> </div>
</div> <div class="dropdown">
<a href="https://www.cnblogs.com/RankFan/category/1996733.html" target="_Blank" class="dropbtn">MIDAS</a>
<div class="dropdown-content"> </div>
</div> <div class="dropdown">
<a href="https://www.cnblogs.com/RankFan/category/2037003.html" class="dropbtn">網站搭建</a>
<div class="dropdown-content"> </div>
</div> <div class="dropdown">
<a target="_Blank" class="dropbtn">學習資源</a>
<div class="dropdown-content">
<a class="menu" href="https://docs.djangoproject.com/en/2.0/" target="_Blank">1.Django2.0官網</a>
<a class="menu" href="http://docs.jinkan.org/docs/flask/" target="_Blank">2.Flask文件</a>
<a class="menu" href="http://www.runoob.com/bootstrap/bootstrap-tutorial.html" target="_Blank">3.Bootstrap教程</a>
<a class="menu" href="http://www.django-rest-framework.org/" target="_Blank">4.REST framework官網</a>
</div>
</div> <div class="dropdown">
<a href="https://mp.weixin.qq.com/s/gOer3XV_Q-Np2PWoRihP3g" target="_Blank" class="dropbtn">公眾號</a>
</div> <div class="dropdown">
<a href="https://i.cnblogs.com/settings" target="_Blank" class="dropbtn">Blogs設定</a>
</div> </ul>
</div> <!-- 快速返回頂部 -->
<!-- 指定返回頂部位置#shwtop -->
<a href="#shwtop"><div id="toTop" style="zoom:0;"></div></a> <!--新增頁面放大和縮小功能按鍵 -->
<div id="divExpandViewArea" onclick="$('#main_container').css({'margin-left':'-154px'});$('#leftmenu').css({'display':'none'});">擴大</div>
<div id="divCollapseViewArea" onclick="$('#main_container').css({'margin-left':'40px', 'margin-right':'40px'});$('#leftmenu').css({'display':'block'});">縮小</div>

頁首

  1 <!-- code 複製設定 -->
2 <script src="https://files.cnblogs.com/files/fenggwsx/clipboard.min.js"></script>
3 <script src="https://files.cnblogs.com/files/fenggwsx/cp.js"></script>
4
5 async function SyncICOLoader() {
6 const flag = `ico`
7 const ico = window.ico ?? false
8 if (Done(flag) || !ico) return
9 await Sync(flag, async _ => {
10 document.querySelector(`#favicon`).href = ico
11 })
12 console.log({ico: ico})
13 }
14
15
16 <script>
17 window.ico = `https://pic.cnblogs.com/avatar/2355125/20210411202630.png` /*可定製ico*/
18 </script>
19
20
21 <!-- 生成部落格目錄的JS程式碼,兩級目錄 -->
22 <script type="text/javascript">
23 /*
24 這段程式碼按H2、H3格式生成兩級選單
25 寫部落格按H2、H3格式寫,不然生成不了
26 Markdown寫作按##、###兩級目錄寫
27 當然你也可以改寫程式碼成三級選單
28 參考:孤傲蒼狼 zhang_derek
29 洪衛 2018-5-18
30 */
31 var BlogDirectory = {
32 /* 獲取元素位置,距瀏覽器左邊界的距離(left)和距瀏覽器上邊界的距離(top)*/
33 getElementPosition:function (ele) {
34 var topPosition = 0;
35 var leftPosition = 0;
36 while (ele){
37 topPosition += ele.offsetTop;
38 leftPosition += ele.offsetLeft;
39 ele = ele.offsetParent;
40 }
41 return {top:topPosition, left:leftPosition};
42 },
43 /*獲取滾動條當前位置 */
44 getScrollBarPosition:function () {
45 var scrollBarPosition = document.body.scrollTop || document.documentElement.scrollTop;
46 return scrollBarPosition;
47 },
48 /* 移動滾動條,finalPos 為目的位置,internal 為移動速度 */
49 moveScrollBar:function(finalpos, interval) {
50 //若不支援此方法,則退出
51 if(!window.scrollTo) {
52 return false;
53 }
54
55 //窗體滾動時,禁用滑鼠滾輪
56 window.onmousewheel = function(){
57 return false;
58 };
59
60 //清除計時
61 if (document.body.movement) {
62 clearTimeout(document.body.movement);
63 }
64
65 //獲取滾動條當前位置
66 var currentpos =BlogDirectory.getScrollBarPosition();
67
68 var dist = 0;
69 //到達預定位置,則解禁滑鼠滾輪,並退出
70 if (currentpos == finalpos) {
71 window.onmousewheel = function(){
72 return true;
73 }
74 return true;
75 }
76 //未到達,則計算下一步所要移動的距離
77 if (currentpos < finalpos) {
78 dist = Math.ceil((finalpos - currentpos)/10);
79 currentpos += dist;
80 }
81 if (currentpos > finalpos) {
82 dist = Math.ceil((currentpos - finalpos)/10);
83 currentpos -= dist;
84 }
85
86 var scrTop = BlogDirectory.getScrollBarPosition();//獲取滾動條當前位置
87 window.scrollTo(0, currentpos);//移動視窗
88 if(BlogDirectory.getScrollBarPosition() == scrTop)//若已到底部,則解禁滑鼠滾輪,並退出
89 {
90 window.onmousewheel = function(){
91 return true;
92 }
93 return true;
94 }
95
96 //進行下一步移動
97 var repeat = "BlogDirectory.moveScrollBar(" + finalpos + "," + interval + ")";
98 document.body.movement = setTimeout(repeat, interval);
99 },
100
101 htmlDecode:function (text){
102 var temp = document.createElement("div");
103 temp.innerHTML = text;
104 var output = temp.innerText || temp.textContent;
105 temp = null;
106 return output;
107 },
108
109 /*
110 建立部落格目錄,id表示包含博文正文的 div 容器的 id,
111 mt 和 st 分別表示主標題和次級標題的標籤名稱(如 H2、H3,大寫或小寫都可以!),
112 interval 表示移動的速度
113 */
114 createBlogDirectory:function (id, mt, st, interval){
115 //獲取博文正文div容器
116 var elem = document.getElementById(id);
117 if(!elem) return false;
118 //獲取div中所有元素結點
119 var nodes = elem.getElementsByTagName("*");
120 //建立部落格目錄的div容器
121 var divSideBar = document.createElement('DIV');
122 divSideBar.className = 'uprightsideBar';
123 divSideBar.setAttribute('id', 'uprightsideBar');
124 var divSideBarTab = document.createElement('DIV');
125 divSideBarTab.setAttribute('id', 'sideBarTab');
126 divSideBar.appendChild(divSideBarTab);
127 var h2 = document.createElement('H2');
128 divSideBarTab.appendChild(h2);
129 var txt = document.createTextNode('目錄導航');
130 h2.appendChild(txt);
131 var divSideBarContents = document.createElement('DIV');
132 divSideBarContents.style.display = 'none';
133 divSideBarContents.setAttribute('id', 'sideBarContents');
134 divSideBar.appendChild(divSideBarContents);
135 //建立自定義列表
136 var dlist = document.createElement("dl");
137 divSideBarContents.appendChild(dlist);
138 var num = 0;//統計找到的mt和st
139 mt = mt.toUpperCase();//轉化成大寫
140 st = st.toUpperCase();//轉化成大寫
141 //遍歷所有元素結點
142 for(var i=0; i<nodes.length; i++)
143 {
144 if(nodes[i].nodeName == mt|| nodes[i].nodeName == st)
145 {
146 //獲取標題文字
147 var nodetext = nodes[i].innerHTML.replace(/<\/?[^>]+>/g,"");//innerHTML裡面的內容可能有HTML標籤,所以用正則表示式去除HTML的標籤
148 nodetext = nodetext.replace(/ /ig, "");//替換掉所有的
149 nodetext = BlogDirectory.htmlDecode(nodetext);
150 //插入錨
151 nodes[i].setAttribute("id", "blogTitle" + num);
152 var item;
153 switch(nodes[i].nodeName)
154 {
155 case mt: //若為主標題
156 item = document.createElement("dt");
157 break;
158 case st: //若為子標題
159 item = document.createElement("dd");
160 break;
161 }
162
163 //建立錨鏈接
164 var itemtext = document.createTextNode(nodetext);
165 item.appendChild(itemtext);
166 item.setAttribute("name", num);
167 //新增滑鼠點選觸發函式
168 item.onclick = function(){
169 var pos = BlogDirectory.getElementPosition(document.getElementById("blogTitle" + this.getAttribute("name")));
170 if(!BlogDirectory.moveScrollBar(pos.top, interval)) return false;
171 };
172 //將自定義表項加入自定義列表中
173 dlist.appendChild(item);
174 num++;
175 }
176 }
177
178 if(num == 0) return false;
179 /* 滑鼠進入時的事件處理 */
180 divSideBarTab.onmouseenter = function(){
181 divSideBarContents.style.display = 'block';
182 }
183 /* 滑鼠離開時的事件處理 */
184 divSideBar.onmouseleave = function() {
185 divSideBarContents.style.display = 'none';
186 }
187
188 document.body.appendChild(divSideBar);
189 }
190
191 };
192
193 window.onload=function(){
194 /* 頁面載入完成之後生成部落格目錄 */
195 BlogDirectory.createBlogDirectory("cnblogs_post_body","h2","h3",20);
196
197 //為右下角推薦推薦區域新增關注按鈕
198 $('#div_digg').prepend('<div style="padding-bottom: 5px"><span class="icon_favorite" style="padding-top: 2px"></span><a onclick="cnblogs.UserManager.FollowBlogger(\'9a35f2c7-18ab-e111-aa3f-842b2b196315\');" href="javascript:void(0);" style="font-weight: bold; padding-left:5px;">關注一下樓主吧</a> </div>');
199 }
200 </script>

頁尾