-
Notifications
You must be signed in to change notification settings - Fork 2
/
tt3.js
45 lines (41 loc) · 966 Bytes
/
tt3.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
var TT3 = {
};
TT3.tree = function(config) {
var root = $(config.element);
root.find('div.head').click(
function() {
$(this).closest('div.element').toggleClass('open');
}
);
};
TT3.tabset = function(config) {
var root = $(config.element);
root.find('ul.tabs li a').click(
function() {
var that = $(this);
that.closest('li').make_warm();
$(that.attr('href')).make_warm();
return false;
}
);
};
jQuery.fn.extend({
tt3_tree: function() {
this.each(
function() {
TT3.tree({ element: this });
}
);
},
tt3_tabset: function() {
this.each(
function() {
TT3.tabset({ element: this });
}
);
},
make_warm: function() {
this.addClass('warm').siblings('.warm').removeClass('warm');
return this;
},
});