• Downloading from our site will require you to have a paid membership. Upgrade to a Premium Membership from 10$ a month today!

    Dont forget read our Rules! Also anyone caught Sharing this content will be banned. By using this site you are agreeing to our rules so read them. Saying I did not know is simply not an excuse! You have been warned.

Forum Collapse using JQuery

Admin

Well-Known Member
Staff member
Administrator
Make Forum item and forum list collapseable

Add new template --> name it as you want (in this i called forum_collapse--> and then put this code

HTML:
<script type="text/javascript">
jQuery(document).ready(function () {
        jQuery(".forum-list-container .forum-item").show();
        jQuery("tr.subforum-list").show();
        //toggle the componenet with class msg_body
        jQuery("TR.category-header").click(function () {
                    jQuery(this).nextUntil(".forum-list-container .forum-item").slideToggle(100);
                    jQuery(this).next("tr.subforum-list").slideToggle(100);
                    jQuery(this).nextUntil("TR.category-header").slideToggle(100);
                });
});       
</script>

and then...

edit template footer...and find this line
HTML:
<script type="text/javascript" src="{vb:raw jqueryurl}"></script>
<script type="text/javascript">window.jQuery || document.write('<script type="text/javascript" src="{vb:raw baseurl}/js/jquery/jquery-{vb:raw jqueryversion}.min.js"><\/script>');</script>

{vb:js 1, js/footer-rollup.js}

and then...add this line...after above line
Code:
{vb:template forum_collapse}

but there is some kind of bug that i cannot solve it yet...if forum category consist no forum item...it still collapse but it will roll another forum category...anyone can help me with this bug?to optimize my code maybe?

Best Regards

Godarmy
 

Facebook Comments

New posts New threads New resources

Back
Top