增加了 jquery.tree 插件
This commit is contained in:
parent
792f91c43e
commit
79c6c7e1af
|
@ -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 );
|
Loading…
Reference in New Issue