Forum Collapse using JQuery

  • Thread starter Thread starter AdminAdmin is verified member.
  • Start date Start date
Admin

AdminAdmin is verified member.

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

Similar threads

Admin
Replies
0
Views
2K
AdminAdmin is verified member.
Admin
Admin
Replies
0
Views
3K
AdminAdmin is verified member.
Admin
Admin
Replies
1
Views
2K
AdminAdmin is verified member.
Admin
hungdanchoi5
Replies
1
Views
1K
AdminAdmin is verified member.
Admin
Admin
Replies
0
Views
1K
AdminAdmin is verified member.
Admin
Admin
Replies
0
Views
1K
AdminAdmin is verified member.
Admin
Admin
Replies
0
Views
699
AdminAdmin is verified member.
Admin
Admin
Replies
0
Views
916
AdminAdmin is verified member.
Admin
Back
Top