增加了 jquery.tree 插件

This commit is contained in:
Li Jianxuan 2011-12-16 09:49:12 +00:00
parent 792f91c43e
commit 79c6c7e1af
1 changed files with 23 additions and 0 deletions

23
htdocs/js/jquery.tree.js Normal file
View File

@ -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 );