From 79c6c7e1afc0fc560de7a93b6a1ba2d76cb4e426 Mon Sep 17 00:00:00 2001 From: Li Jianxuan Date: Fri, 16 Dec 2011 09:49:12 +0000 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BA=86=20jquery.tree=20?= =?UTF-8?q?=E6=8F=92=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/js/jquery.tree.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 htdocs/js/jquery.tree.js diff --git a/htdocs/js/jquery.tree.js b/htdocs/js/jquery.tree.js new file mode 100644 index 00000000..df3affb1 --- /dev/null +++ b/htdocs/js/jquery.tree.js @@ -0,0 +1,23 @@ +(function( $ ){ + + $.fn.tree = function(options) { + + var defualts = { + 'toggle':'.tree-toggle-btn', + 'downImg':'/images/plus.gif', + 'upImg':'/images/minus.gif' + }; + + var opts = $.extend({}, defualts, options); + + $(opts.toggle).addClass("tree-toggle-down"); + + this.each(function() { + $(this).children('.expandable').each(function (){ + $(this).children('.tree-toggle-btn').bind('click', function() { + $(this).parent().children('ul').slideToggle("slow"); + }); + }); + }); + }; +})( jQuery ); \ No newline at end of file