Skip to content
This repository was archived by the owner on Apr 18, 2019. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .idea/scopes/scope_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions _includes/scripts.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<script src="{{ "/assets/js/jquery.pjax.js" | prepend: site.baseurl }}"></script>
<script src="{{ "/assets/js/nprogress.js" | prepend: site.baseurl }}"></script>
<script src="{{ "/assets/js/main.js" | prepend: site.baseurl }}"></script>
<script src="{{ "/assets/js/searchbox.js" | prepend: site.baseurl }}"></script>

{% if site.google_analytics %}
<script>
Expand Down
29 changes: 29 additions & 0 deletions assets/js/searchbox.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/**
* Created by zteliuyw on 15/5/29.
*/

$(function(){


//搜索框文字变化时间
$("#search-input").keyup(function(){
//$("#s-box").hide("slow");
var text = $("#search-input").val().toLowerCase();
//console.log(text);

if(text =="" || text==undefined){
$(".toc-link").show();
}else{
$(".toc-link").hide();
$(".toc-link").each(function(){
var htmlstr = $(this).html().toLowerCase();
if(htmlstr.indexOf(text) != -1){
console.log(htmlstr);
$(this).show();
}
})
}


})
})