!function(){/*《彩云小译js注入版v1.0》【说明】按钮开关“yF”是上滑隐藏下滑显示的。只有点击开关后才会联网加载彩云小译的js脚本*/if(!document.getElementById("gzfy")){var zfyan=document.createElement("span");zfyan.id="gzfy";zfyan.innerHTML="YF";zfyan.style.cssText="display:none;text-align:center !important;font-size:20px;width:28px;height:28px;line-height:28px;text-align:center;float:right;position:fixed;right:52px;top:60%;color:#000;opacity:0.8;background:#e3edcd;cursor:pointer;position:fixed !important;z-index:9999999999 !important;box-shadow:0px 1px 1px #000;border-radius:50%";zfyan.addEventListener("click",function(){zfy()});document.body.appendChild(zfyan);}var zfyhdy1,zfyhdy2;document.addEventListener("touchstart",function(e){zfyhdy1=e.changedTouches[0].clientY});document.addEventListener("touchmove",function(e){zfyhdy2=e.changedTouches[0].clientY;document.getElementById("gzfy").style.display=zfyhdy2-zfyhdy1>0?"block":"none"});function zfy(){var zfyfy=document.getElementById("gzfy");zfyfy.parentNode.removeChild(zfyfy);var cyfy=document.createElement("script");cyfy.type="text/javascript";cyfy.charset="UTF-8";cyfy.src=("https:"==document.location.protocol?" https://":"http://")+"caiyunapp.com/dest/trs.js";document.body.appendChild(cyfy); }}();
/*刷新.翻页按钮*/ {var totn=document.createElement("div"); totn.innerHTML="↻"; totn.setAttribute ("style","opacity:0.1; font-size:8vw !important; width:10vw !important; height:10vw !important; line-height:10vw !important; text-align:center !important; background-color:rgba(0,0,0,0) !important; box-shadow:0px 0px 1px rgba(0,0,0,0) !important; position:fixed !important; bottom:50vh !important; right:3.3vw !important; z-index:99999 !important; border-radius:100% !important;"); totn.onclick=function (){window.location.reload();}; document.getElementsByTagName("html").item(0).appendChild(totn);}; {var uptotn=document.createElement("div"); uptotn.innerHTML="﹀"; uptotn.setAttribute("style","opacity:0.1;font-size:8vw !important; width:10vw !important; height:10vw !important; line-height:10vw !important; text-align:center !important; background-color:rgba(0,0,0,0) !important; box-shadow:0px 0px 1px rgba(0,0,0,0) !important; position:fixed !important; bottom:42vh !important; right:3.3vw !important; z-index:99999 !important; border-radius:100% !important;"); uptotn.onclick=function (){window.scrollBy(0,658); }; document.getElementsByTagName("html").item(0).appendChild(uptotn); var Dtotn=document.createElement("div"); Dtotn.innerHTML="︿"; Dtotn.setAttribute( "style","opacity:0.1;font-size:8vw !important; width:10vw !important; height:10vw !important; line-height:10vw !important; text-align:center !important; background-color:rgba(0,0,0,0) !important; box-shadow:0px 0px 1px rgba(0,0,0,0) !important; position:fixed !important; bottom:58vh !important; right:3.3vw !important; z-index:99999 !important; border-radius:100% !important;"); Dtotn.onclick=function (){window.scrollBy(0,-658); }; document.getElementsByTagName("html").item(0).appendChild(Dtotn); };
hexo博客搜索插件请前往 Hexo-Search
也可以打开http://codeboy.me查看效果
将search目录放至于博客根目录下,其中search目录结构如下:
search ├── cb-footer-add.html ├── cb-search.json ├── css │ └── cb-search.css ├── img │ ├── cb-close.png │ └── cb-search.png └── js ├── bootstrap3-typeahead.min.js └── cb-search.js
在 _include/footer.html 中的 </footer> 后加入 cb-footer-add.html 中的内容即可。
_include/footer.html
</footer>
cb-footer-add.html
1.需要事先引入jquery与bootstrap3(js与css文件)框架,如果没有的话,操作如下:
在_include/head.html 中引入以下代码:
_include/head.html
<link rel="stylesheet" href="//cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap.min.css">
在_include/footer.html 中引入以下代码:
<!-- jQuery --> <script src="//cdn.bootcss.com/jquery/2.2.2/jquery.min.js"></script> <!-- Bootstrap Core JavaScript --> <script src="//cdn.bootcss.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
bootstrap3-typeahead.min.js 的引入必须在jquery.min.js引入之后,即在footer.html中的行数更靠后!
bootstrap3-typeahead.min.js
jquery.min.js
footer.html
2.默认联想8个,如果需要更多的话,请检索 bootstrap3-typeahead.min.js 中的items:8, 将8替换成自己需要的数值。
Copyright 2016 Yuedong.li Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
有任何问题,欢迎发送邮件到app@codeboy.me交流.