The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Cant get toggle to work

Go down

Solved Cant get toggle to work

Post by APE on October 23rd 2011, 9:06 pm

Hi all
i have been trying to get this to work but can't
http://help.forumotion.com/t96460-category-toggle-script
i have done as it said and still cant get it to work Sad
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 Neutral


Last edited by ape man on October 26th 2011, 4:42 pm; edited 1 time in total
avatar
APE
Manager
Manager

Male Posts : 11633
Reputation : 1134
Language : fluent in dork / mumbojumbo & English haha
Location : STUCK IN FORUMOTIONS SERVERS HELP ME !!!!!!

http://chatworld.forumotion.co.uk/

Back to top Go down

Solved Re: Cant get toggle to work

Post by YoshiGM on October 26th 2011, 12:09 am

Have you added the CSS Code after you pasted the Java ?
avatar
YoshiGM
Forumember

Male Posts : 691
Reputation : 97
Language : Spanish, English & Italian (16%)
Location : Mexico

http://asistencia.foroactivo.com/u21373

Back to top Go down

Solved Re: Cant get toggle to work

Post by Base on October 26th 2011, 10:44 am

Hi!

Have you followed the other steps correctly? Please also note that this tutorial does not support forums running on version phpBB 2. Smile
avatar
Base
Forumaster

Male Posts : 10386
Reputation : 1693
Language : English and French
Location : United Kingdom, England

http://forumotionhub.net

Back to top Go down

Solved Re: Cant get toggle to work

Post by Guest on October 26th 2011, 11:34 am

Add in the description of the last forum Smile Exemple: Trash / Garbage

Guest
Guest


Back to top Go down

Solved Re: Cant get toggle to work

Post by APE on October 26th 2011, 4:35 pm

ok i have worked it out i have played about with some things and got it working thank you guys
avatar
APE
Manager
Manager

Male Posts : 11633
Reputation : 1134
Language : fluent in dork / mumbojumbo & English haha
Location : STUCK IN FORUMOTIONS SERVERS HELP ME !!!!!!

http://chatworld.forumotion.co.uk/

Back to top Go down

Solved Re: Cant get toggle to work

Post by Nera. on October 26th 2011, 4:43 pm

Lock
avatar
Nera.
Energetic

Female Posts : 7078
Reputation : 2014
Language : English
Location : -

http://webartzforum.com

Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum