第一步: 先在後台 新增小工具 -> 選安裝 標籤 , 再在後台 範本 -> 編輯HTML , 搜尋這標籤 以下片段: <ul> <b:loop values='data:labels' var='label'> <li> <b:if cond='data:blog.url == data:label.url'> <data:label.name/> <b:else/> <a expr:href='data:label.url'> </b:if> () </li> </b:loop> </ul> 將以上內容替換為下列紅字: <script> var ALLlabel = []; <b:loop values='data:labels'var='label'> ALLx1 = ""; ALLx2 = ""; ALLlabel.push(ALLx1); ALLlabel.push(ALLx2); </b:loop> </script>
第二步: 先在後台 新增小工具 -> 選安裝 HTML/JavaScripts , 再在後編輯 以下程式, <style> #cckDP { position:fixed; transform: translateZ(0); /* 开启 GPU 加速 */ backface-visibility: hidden; top:0px;left: 5px} .ALLselect { width:120px; font-size: 25px;} </style> <div id="cckDP"> <select class='ALLselect' id='ALL管理員' onchange='location=this.options [this.selectedIndex].value;' onmouseover='this.focus()'> <option style="display:none;" />管理員 </select> <br /> <select class='ALLselect' id='ALLBlogger' onchange='location=this.options [this.selectedIndex].value;' onmouseover='this.focus()'> <option style="display:none;" />Blogger </select> <br /> <select class='ALLselect' id='ALLTtags' onchange='location=this.options [this.selectedIndex].value;' onmouseover='this.focus()'> <option style="display:none;" />tag </select> <br /> <select class='ALLselect' id='ALLscript' onchange='location=this.options [this.selectedIndex].value;' onmouseover='this.focus()'> <option style="display:none;" />Script </select> <br /> <select class='ALLselect' id='ALLcss' onchange='location=this.options [this.selectedIndex].value;' onblur onmouseover='this.focus()'> <option style="display:none;" />CSS </select> <br /> <select class='ALLselect' id='ALLjquery' onchange='location=this.options [this.selectedIndex].value;' onmouseover='this.focus()'> <option style="display:none;" /> jquery </select> <select class='ALLselect' id='ALLother' onchange='location=this.options [this.selectedIndex].value;' onmouseover='this.focus()'> <option style="display:none;" />other </select> </div> <br /> <script type="text/javascript"> var Alllength = ALLlabel.length; var i; for (i = 0 ;i < Alllength; i=i+2 ){ var okok = 0 ; if(ALLlabel[i].indexOf('管理員') > -1 && okok == 0){ var x = document.getElementById("ALL管理員"); var option = document.createElement("option"); var value = document.createElement("value"); option.text = ALLlabel[i].replace(/管理員/,""); option.value =ALLlabel[i+1]; x.add(option);okok=1;} if(ALLlabel[i].indexOf('Blogger') > -1 && okok == 0){ var x = document.getElementById("ALLBlogger"); var option = document.createElement("option"); var value = document.createElement("value"); option.text = ALLlabel[i].replace(/Blogger/,""); option.value =ALLlabel[i+1]; x.add(option);okok=1;} if(ALLlabel[i].indexOf('tag') > -1 && okok == 0){ var x = document.getElementById("ALLTtags"); var option = document.createElement("option"); var value = document.createElement("value"); ALLlabel[i] = ALLlabel[i].replace(/tag/,""); option.text = ALLlabel[i].replace(/tag/,"") ; option.value =ALLlabel[i+1]; x.add(option);okok=1;} if(ALLlabel[i].indexOf('script') > -1 && okok == 0){ var x = document.getElementById("ALLscript"); var option = document.createElement("option"); var value = document.createElement("value"); option.text = ALLlabel[i].replace(/script/,""); option.value =ALLlabel[i+1]; x.add(option);okok=1;} if(ALLlabel[i].indexOf('CSS') > -1 && okok == 0){ var x = document.getElementById("ALLcss"); var option = document.createElement("option"); var value = document.createElement("value"); option.text = ALLlabel[i].replace(/CSS/,""); option.value =ALLlabel[i+1]; x.add(option);okok=1;} if(ALLlabel[i].indexOf('jquery') > -1 && okok == 0){ var x = document.getElementById("ALLjquery"); var option = document.createElement("option"); var value = document.createElement("value"); option.text = ALLlabel[i].replace(/jquery/,""); option.value =ALLlabel[i+1]; x.add(option);okok=1;} if(okok == 0){ var x = document.getElementById("ALLother"); var option = document.createElement("option"); var value = document.createElement("value"); option.text = ALLlabel[i]; option.value =ALLlabel[i+1]; x.add(option);okok=1;} } </script>
沒有留言:
發佈留言