vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 5.x Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=259)
-   -   Miscellaneous Hacks - Forum Collapse using JQuery (https://vborg.vbsupport.ru/showthread.php?t=300249)

godarmy 07-17-2013 10:00 PM

Forum Collapse using JQuery
 
1 Attachment(s)
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").fadeToggle(100);
                    jQuery(this).next("tr.subforum-list").fadeToggle(100);
                    jQuery(this).nextUntil("TR.category-header").fadeToggle(100);
                });
});     
</script>

and then...

edit template header...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>

and then...add this line...after below line
Code:

<vb:if condition="$page['channelid'] == 1 OR $page['channelid'] == 1" />
{vb:template forum_collapse}
</vb:if>

also we can combine it.. with css to do some animation like folder tree

Best Regards

Godarmy

napy8gen 08-20-2013 06:06 AM

the jquery is now in footer template.

Quote:

<vb:if condition="$page['channelid'] == 1 OR $page['channelid'] == 1" />
should not have closed tag at the end

Quote:

<vb:if condition="$page['channelid'] == 1 OR $page['channelid'] == 1" >
it would be great is is using default vb5 collapse slide animation and collapse button

SirPereira 03-19-2014 12:48 AM

Can we have a possible demo or screenshot please?

hkwibawa 09-25-2014 01:45 AM

Hi,

it works for me ( using vb 5 ) ....
and how can I make the sub forums in a state of collapse on the main page so that it does not require a lot of scrolling because of the many sub forums ?

thanks in advance

Hectorsky 11-18-2015 01:34 PM

which header template? i didn't found that code in header template

eroyka 01-10-2021 07:05 PM

Quote:

Originally Posted by Hectorsky (Post 2558932)
which header template? i didn't found that code in header template

Not in header... is in footer template.


All times are GMT. The time now is 05:32 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02009 seconds
  • Memory Usage 1,725KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete