Man, I was sure there was an easy way to do that but looking at the source it uses javascript, and it doesnt look easy..
in file js/menucollapse.js the source is this:
Spoiler (Click to Expand)
var closedarr = {};
2: var parsedcookieintoarr = false;
3: var allcollapsed = false;
4: var numsections = 0;
5:
6: function assignmenuevents(e) {
7:
8: menusets = readCookie('menusets');
9: if (menusets)
10: closedarr = eval(menusets);
11:
12: parsedcookieintoarr = true;
13:
14: if (document.getElementsByTagName) {
15: var x = document.getElementsByTagName('H4');
16: var w = document.getElementById('image-extra1');
17: } else if (document.all) {
18: var x = document.all.tags('H4');
19: var w = document.all['image-extra1'];
20: } else return;
21:
22: w.onmouseup = menuallclicked;
23:
24: for (var i=0;i
25: {
26: if (x[i].className.indexOf('menuheading') != -1)
27: numsections++;
28:
29: x[i].onmouseup = menusetstate;
30: x[i].style.cursor = 'default';
31:
32: var setid = x[i].id.substr(11);
33: if (setid in closedarr) {
34:
35: if (document.getElementById)
36: var set = document.getElementById('menuset'+setid);
37: else if (document.all)
38: var set = document.all['menuset'+setid];
39: else return;
40:
41: if (set.className != 'menuset clicked') {
42: set.className = 'menuset clicked';
43: x[i].className = 'menuheading clicked';
44: } else {
45: x[i].className = 'menuheading unclicked';
46: set.className = 'menuset unclicked';
47: }
48:
49: }
50:
51: }
52:
53: }
54:
55: function savemenupositions(e) {
56:
57: var saveclosed = obj2str(closedarr);
58:
59: // Navigating away from a page before it had loaded was unsetting the closed array
60: if (parsedcookieintoarr)
61: setCookie('menusets',saveclosed,365);
62:
63: }
64:
65:
66: function menusetstate(e) {
67:
68: var targ;
69:
70: if (!e) var e = window.event;
71:
72: if (e.target) targ = e.target;
73: else if (e.srcElement) targ = e.srcElement;
74: if (targ.nodeType == 3) // defeat Safari bug
75: targ = targ.parentNode;
76:
77: var setid = targ.id.substr(11);
78:
79: if (document.getElementById)
80: var set = document.getElementById('menuset'+setid);
81: else if (document.all)
82: var set = document.all['menuset'+setid];
83: else return;
84:
85: if (set.className == 'menuset clicked') {
86: set.className = 'menuset unclicked';
87: targ.className = 'menuheading unclicked';
88: if (setid in closedarr) delete closedarr[setid];
89: }
90: else {
91: set.className = 'menuset clicked';
92: targ.className = 'menuheading clicked';
93: closedarr[setid] = true;
94: }
95:
96: }
97:
98: function menuallclicked(e) {
99:
100: if (objsize(closedarr) >= numsections)
101: var collapseem = false;
102: else
103: var collapseem = true;
104:
105: menusetallstate(collapseem);
106:
107: }
108:
109: function menusetallstate(collapse) {
110:
111: if (document.getElementsByTagName)
112: var x = document.getElementsByTagName('H4');
113: else if (document.all)
114: var x = document.all.tags('H4');
115: else return;
116: for (var i=0;i
117: {
118: if (x[i].className.indexOf('menuheading') != -1)
119:
120: var setid = x[i].id.substr(11);
121:
122: if (document.getElementById)
123: var set = document.getElementById('menuset'+setid);
124: else if (document.all)
125: var set = document.all['menuset'+setid];
126: else return;
127:
128: if (collapse) {
129: set.className = 'menuset clicked';
130: x[i].className = 'menuheading clicked';
131: closedarr[setid] = true;
132: } else {
133: x[i].className = 'menuheading unclicked';
134: set.className = 'menuset unclicked';
135: if (setid in closedarr) delete closedarr[setid];
136: }
137: }
138:
139: }
140:
141: function obj2str (obj) {
142: try {
143: return uneval(obj);
144: } catch(e) {
145: bits = new Array();
146: for (p in obj) {
147: bits.push(p + ':' + obj[p]);
148: }
149: return '({' + bits.join(', ') + '})';
150: }
151: }
152: function objsize (obj) {
153: var size = 0;
154: for (var property in obj) {
155: size++;
156: }
157: return size;
158: }
159:
160: addonload('assignmenuevents');
161: addonunload('savemenupositions');
have fun!
Your Comments: