- Code:
$(function() {
var style = document.createElement("style"),
oCat = $('#main-content .forabg'),
oThis = null;
style.type = "text/css";
style.innerHTML =
'div.forabg .contract, div.forabg .expand {' +
' background: url("http://2img.net/i/fa/invision/exp_minus.gif") no-repeat scroll 50% 50% rgba(0, 0, 0, 0);' +
' cursor: pointer;' +
' float: right;' +
'}' +
'div.forabg .expand {' +
' background: url("http://2img.net/i/fa/invision/exp_plus.gif") no-repeat scroll 50% 50% rgba(0, 0, 0, 0);' +
'}';
document.getElementsByTagName("head")[0].appendChild(style);
for (var i = 0, len = oCat.length; i < len; i++) {
oThis = $(oCat[i]);
oThis.find('ul.topiclist:first dl.icon')
.append('<div onclick="toggleCategory(\'c' + i + '\');" id="bc' + i + '" class="contract"> </div>');
oThis.find('ul.topiclist.forums').attr('id', 'c' + i);
}
});
// by invision.js
function initCategories() {
var id;
cookies = document.cookie.split('; ');
for (var i = 0; i < cookies.length; i++) {
if (cookies[i].charAt(0) == '_') {
cookie = cookies[i].split('=');
if (cookie[1] == '1') {
id = cookie[0].substring(1);
if (document.getElementById(id)) {
toggleCategory(id)
}
}
}
}
}
// by invision.js
function toggleCategory(id) {
var obj = document.getElementById(id);
var button = document.getElementById('b' + id);
var toggle = obj.style.display == 'none';
obj.style.display = toggle ? '' : 'none';
button.className = toggle ? 'contract' : 'expand';
my_setcookie('_' + id, toggle ? '' : '1', true);
return false
}
initCategories();
This is a Hitskin.com skin preview
Install the skin • Return to the skin page