Jump to content
vBWarez - Rest In Peace

Forum Collapse using JQuery


Recommended Posts

[B][COLOR="#FF0000"]vB Version: 5.0.x[/COLOR][/B]

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

[CODE]<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>[/CODE]

and then...

edit template footer...and find this line

[CODE]<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}[/CODE]

and then...add this line...after above line

[CODE]{vb:template forum_collapse}[/CODE]

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?
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...