MyBB Community Forums

Full Version: Collapse/Expand Forum
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
http://omniverse-rpg.com/index.php

You can do this as a guest, but if you tick the little sliders on the right of each forum section they flash twice before collapsing. Once you do this they're stuck collapsed, even if you refresh. 

[Image: 97a08a8a1e68732d6df30350bb9b9c99.gif]

The gif above is what happens. Any help would be appreciated. Or even where I could start looking?
Is this happening with default theme as well?
It is working properly on the Default theme. I've been going back and forth between the two templates trying to see what may be causing it. I'm also trying to find what CSS controls that function and if it may be doing it.

EDIT: On that same note the template/theme it's happening on is edited. We have a side bar and multiple template edits. I kind of inherited this and the themes we're using were for 1.8.7, but we were forced to update to 1.8.15 because the Admin CP had just...stopped working in some places. Throwing 500 and 403 errors for certain pages.

EDIT2 For Posterity: 

Current code in forumbit_depth1_cat

<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<thead>
<tr>
<td class="thead{$expthead}" colspan="5">
<div class="expcolimage"><img src="{$theme['imgdir']}/{$expcolimage}" id="cat_{$forum['fid']}_img" class="expander" alt="{$expaltext}" title="{$expaltext}" /></div>
<div><strong><a href="{$forum_url}">{$forum['name']}</a></strong><br /><div class="smalltext">{$forum['description']}</div></div>
</td>
</tr>
</thead>
<tbody style="{$expdisplay}" id="cat_{$forum['fid']}_e">

{$sub_forums}
</tbody>
</table>
<br />
You have same script loaded thrice in your headerinclude.

<script type="text/javascript" src="http://omniverse-rpg.com/jscripts/general.js?ver=1807"></script>
<script type="text/javascript" src="http://omniverse-rpg.com/jscripts/general.js?ver=1809"></script>
<script type="text/javascript" src="http://omniverse-rpg.com/jscripts/general.js?ver=1815"></script>

This may cause the issue. Load only the latest one (ver=1815).
Well, now they're not clickable and a bunch of other java script based stuff doesn't work. I assumed those script calls were not backwards compatible (similar to .NET for Microsoft) where if you don't specifically code them to work with every version you'll need the older files to get ANY of it to work. Correct me if I'm wrong though. I'm willing to grant you access to the GuestAdmin account so you can take a look. I'll PM the info if you'd like.



[Image: 66f0b9fe2e2a10b6257157ff652faa37.gif]


EDIT: For Posterity2: The headerinclude of the problem template: 

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.4.0/animate.min.css"> 
<link href='https://fonts.googleapis.com/css?family=Droid+Sans:400,700' rel='stylesheet' type='text/css'/>
<link href='http://fonts.googleapis.com/css?family=Lato:100,300,400,700,900,100italic,300italic,400italic,700italic,900italic' rel='stylesheet' type='text/css' />

<link rel="alternate" type="application/rss+xml" title="{$lang->latest_threads} (RSS 2.0)" href="{$mybb->settings['bburl']}/syndication.php" />
<link rel="alternate" type="application/atom+xml" title="{$lang->latest_threads} (Atom 1.0)" href="{$mybb->settings['bburl']}/syndication.php?type=atom1.0" />
<meta http-equiv="Content-Type" content="text/html; charset={$charset}" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />

<script src="https://use.fontawesome.com/d4e09fbff1.js"></script>
<script type="text/javascript" src="{$mybb->asset_url}/jscripts/jquery.js?ver=1806"></script>
<script type="text/javascript" src="{$mybb->asset_url}/jscripts/jquery.plugins.min.js?ver=1806"></script>
<script type="text/javascript" src="{$mybb->asset_url}/jscripts/general.js?ver=1807"></script>
<script type="text/javascript" src="{$mybb->asset_url}/jscripts/general.js?ver=1809"></script>
<script type="text/javascript" src="{$mybb->asset_url}/jscripts/general.js?ver=1815"></script>
<script type="text/javascript" src="images/revolution/bootstrap.min.js"></script>
<script type="text/javascript" src="images/revolution/jquery.tipsy.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/wow/1.1.2/wow.min.js"></script>
<script> new WOW().init(); </script>

{$stylesheets}

<link href='//maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css' rel='stylesheet' type='text/css'>

<script type="text/javascript">
$(function(){
    // ADD SLIDEDOWN ANIMATION TO DROPDOWN //
    $('.dropdown').on('show.bs.dropdown', function(e){
        $(this).find('.dropdown-menu').first().stop(true, true).slideDown();
    });

    // ADD SLIDEUP ANIMATION TO DROPDOWN //
    $('.dropdown').on('hide.bs.dropdown', function(e){
        e.preventDefault();
        $(this).find('.dropdown-menu').first().stop(true, true).slideUp(400, function(){
            //On Complete, we reset all active dropdown classes and attributes
            //This fixes the visual bug associated with the open class being removed too fast
            $('.dropdown').removeClass('open');
            $('.dropdown').find('.dropdown-toggle').attr('aria-expanded','false');
        });
    });
});
</script>

<script type="text/javascript">
$(function() {
$("a").tipsy({gravity: $.fn.tipsy.autoNS, fade: true});
$("title").tipsy({gravity: $.fn.tipsy.autoNS, fade: true});
$("img").tipsy({gravity: $.fn.tipsy.autoNS, fade: true});
$("i").tipsy({gravity: $.fn.tipsy.autoNS, fade: true});
$("span").tipsy({gravity: $.fn.tipsy.autoNS, fade: true});
$("div").tipsy({gravity: $.fn.tipsy.autoNS, fade: true});
});
</script>

<script type="text/javascript">
jQuery(document).ready(function() {
    var offset = 100;
    var duration = 250;
    jQuery(window).scroll(function() {
        if (jQuery(this).scrollTop() > offset) {
            jQuery(".topforum").fadeIn(duration);
        } else {
            jQuery(".topforum").fadeOut(duration);
        	}
    });
    
    jQuery('.topforum').click(function(event) {
        event.preventDefault();
        jQuery('html, body').animate({scrollTop: 0}, 600);
        	return false;
    	})
});
</script>

<script type="text/javascript">
<!--
    lang.unknown_error = "{$lang->unknown_error}";
    lang.select2_match = "{$lang->select2_match}";
    lang.select2_matches = "{$lang->select2_matches}";
    lang.select2_nomatches = "{$lang->select2_nomatches}";
    lang.select2_inputtooshort_single = "{$lang->select2_inputtooshort_single}";
    lang.select2_inputtooshort_plural = "{$lang->select2_inputtooshort_plural}";
    lang.select2_inputtoolong_single = "{$lang->select2_inputtoolong_single}";
    lang.select2_inputtoolong_plural = "{$lang->select2_inputtoolong_plural}";
    lang.select2_selectiontoobig_single = "{$lang->select2_selectiontoobig_single}";
    lang.select2_selectiontoobig_plural = "{$lang->select2_selectiontoobig_plural}";
    lang.select2_loadmore = "{$lang->select2_loadmore}";
    lang.select2_searching = "{$lang->select2_searching}";
    var cookieDomain = "{$mybb->settings['cookiedomain']}";
    var cookiePath = "{$mybb->settings['cookiepath']}";
    var cookiePrefix = "{$mybb->settings['cookieprefix']}";
    var cookieSecureFlag = "{$mybb->settings['cookiesecureflag']}";
    var deleteevent_confirm = "{$lang->deleteevent_confirm}";
    var removeattach_confirm = "{$lang->removeattach_confirm}";
    var loading_text = '{$lang->ajax_loading}';
    var saving_changes = '{$lang->saving_changes}';
    var use_xmlhttprequest = "{$mybb->settings['use_xmlhttprequest']}";
    var my_post_key = "{$mybb->post_code}";
    var rootpath = "{$mybb->settings['bburl']}";
    var imagepath = "{$theme['imgdir']}";
     var yes_confirm = "{$lang->yes}";
    var no_confirm = "{$lang->no}";
    var MyBBEditor = null;
    var spinner_image = "{$theme['imgdir']}/spinner.gif";
    var spinner = "<img src='" + spinner_image +"' alt='' />";
    var modal_zindex = 9999;
// -->
</script>
There is no point loading the same script thrice. They are not different script, there is no backword incompatibility issue. It was loading the same script again and again.

You have removed your jQuery library (don't know why), add it back. This is now the new error in your console apart from earlier existing 6.

Uncaught ReferenceError: jQuery is not defined
(2018-06-18, 08:00 AM)effone Wrote: [ -> ]There is no point loading the same script thrice. They are not different script, there is no backword incompatibility issue. It was loading the same script again and again.

You have removed your jQuery library (don't know why), add it back. This is now the new error in your console apart from earlier existing 6.

Uncaught ReferenceError: jQuery is not defined

Okay you pointed me in the right direction. I had to update the jQuery's to the newer versions to get everything to fall into place. The problem has magically vanished now. Greatly appreciate the guidance effone. 

New code in headerinclude: 

<script type="text/javascript" src="{$mybb->asset_url}/jscripts/jquery.js?ver=1813"></script>
<script type="text/javascript" src="{$mybb->asset_url}/jscripts/jquery.plugins.min.js?ver=1813"></script>
<script type="text/javascript" src="{$mybb->asset_url}/jscripts/general.js?ver=1815"></script>
Looks all good now. Cheers.
Indeed! Thanks again for the assistance!