From df6ffc3da9d202aa1dd5bcfb363e938871681f44 Mon Sep 17 00:00:00 2001 From: Zach DeCook Date: Tue, 13 Feb 2018 15:11:34 -0500 Subject: * Tabs Project: Initial Commit --- toc-filter.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 toc-filter.js (limited to 'toc-filter.js') diff --git a/toc-filter.js b/toc-filter.js new file mode 100644 index 0000000..08afa2d --- /dev/null +++ b/toc-filter.js @@ -0,0 +1,18 @@ +$(function(){ + $("#toc-filter").bind("change paste keyup", toc_filter); +}); + +function toc_filter( event ) +{ + var val = $(this).val().toLowerCase(); + $("#toc li").each(function(){ + if($(this).text().toLowerCase().indexOf(val) == -1) + { + $(this).hide(); + } + else + { + $(this).show(); + } + }); +} \ No newline at end of file -- cgit 1.4.1