Hi all
i have been trying to get this to work but can't
https://help.forumotion.com/t96460-category-toggle-script
i have done as it said and still cant get it to work
can some one help me please
My code i have is
Ape
i have been trying to get this to work but can't
https://help.forumotion.com/t96460-category-toggle-script
i have done as it said and still cant get it to work
can some one help me please
My code i have is
- Code:
<script type="text/javascript">
function toggleLTcategory(cat) {
var cid=cat.id;
var button=document.getElementById('b'+cid);
if (cat.style.display=='none') {
cat.style.display='block';
button.className='contract';
my_setcookie('_' + cid, '', true);
}
else {
cat.style.display='none';
button.className='expand';
my_setcookie('_' + cid, '1', true);
}
}
jQuery(function () {
x=jQuery('.topiclist .header').get();
for (i=0; i<x.length; i++) {
x[i].style.position='relative';
var cid='c'+String(i+1);
x[i].parentNode.nextSibling.setAttribute('id',cid);
x[i].parentNode.nextSibling.style.display='block';
var y='<div id="b'+cid+'" class="contract" onclick="toggleLTcategory(this.parentNode.parentNode.nextSibling);"></div>';
x[i].innerHTML=x[i].innerHTML+y;
}
cookies = document (.) cookie.split('; ');
for (i in cookies) {
if (cookies[i].charAt(0) == '_') {
cookie = cookies[i].split('=');
if (cookie[1] == '1') {
cid = cookie[0].substring(1);
if (document.getElementById(cid)) {toggleLTcategory(cid);}
}
}
}
});
</script>
Ape
Last edited by ape man on October 26th 2011, 4:42 pm; edited 1 time in total