WordPress.org

Ready to get started?Download WordPress

Forums

Collapse-O-Matic
[resolved] Content only expanded (other threads not helping) (12 posts)

  1. melissa@momodigitaldesign.com
    Member
    Posted 2 months ago #

    The plugin has been installed and working for about a month, and now that I'm about a day away from launching my client's website, it has stopped working and all the content loads as expanded and will not collapse.

    I have reviewed other posts with suggestions of changing some of the plugin settings, but nothing is working for me. If someone could help, I'd REALLY appreciate it!!

    http://momodigitaldesign.com/codyent/codysoft-products/collateral-management-module/

    Thanks,
    Melissa

    https://wordpress.org/plugins/jquery-collapse-o-matic/

  2. thisimnot
    Member
    Posted 2 months ago #

    What is your "Animation Effect:" on the Options page set to?

  3. melissa@momodigitaldesign.com
    Member
    Posted 2 months ago #

    Slide & Fade
    I temporarily activated a different theme on my site to test, and everything worked fine on a different theme. So, I've been backtracking trying to figure out what changes I've made to my theme since the collapsing was last working, and I really think I've just been tweaking the CSS. To verify it wasn't something in the CSS (which wouldn't make sense anyway) I replaced my current style sheet with an older version and that didn't help. I'm at a loss!

  4. thisimnot
    Member
    Posted 2 months ago #

    Have you tried re-installing the plugin?
    Sorry, I'm grasping at straws...

  5. Baden
    Member
    Plugin Author

    Posted 2 months ago #

    Hello, we'll get you fixed up.
    First thing we noticed is the following JS error on your page:
    Uncaught TypeError: undefined is not a function momodigitaldesign.com/codyent/wp-content/plugins/ubermenu/core/js/ubermenu.min.js?ver=3.9.1:19

    Next thing we saw is that that very same plugin is force-loading an ancient version of jQuery:

    <script type="text/javascript"
                src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js">
            </script>

    Can you de-activate the ubermenu plugin, or are you using it?

  6. sevenspark
    Member
    Posted 2 months ago #

    Whoa, whoa, whoa. UberMenu does no such thing. UberMenu uses the standard jQuery library provided with WordPress and does not enqueue its own, nor force load any script.

    You've properly identified that the error is due to that old jQuery library being loaded, but UberMenu is definitely not the source.

    Something is injecting both of these scripts:

    <script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
    
    <script type="text/javascript"
                src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js">
            </script>

    Both of which are wrong and should be removed. (Neither of which is added by UberMenu.)

    FYI the error in UberMenu occurs because it calls off(), a jQuery function which was introduced in jQuery 1.7. The 1.3 library is throwing an error because that function does not exist. Once that extra library is removed, the error will no longer occur.

    Hope that helps!

    Chris

  7. Baden
    Member
    Plugin Author

    Posted 2 months ago #

    Chris, please accept my deepest apologies! You, of course, are exactly right. The force-loading is done AFTER the <!-- end UberMenu CSS -->. Thank you for jumping in and clearing that up. The problem is most likely found in either the header.php or the functions.php file of your theme. Here is a good article that addresses the issue and how to start troubleshooting:
    http://msyk.es/blog/prevent-jquery-wordpress-theme/

    Again, very sorry Chris.

  8. sevenspark
    Member
    Posted 2 months ago #

    No worries, Baden! I consider any non-standard jQuery loading by a theme or plugin to be an egregious offense, so I just wanted to make sure that got cleared up ;) As you know, following best practices like that is critical to avoid theme/plugin conflicts, so that's always a primary focus for me.

    (For anyone else reading this and wondering why this is so important, I recommend this excellent article by Pippin Williamson: Why loading your own jQuery is irresponsible )

    By the way, if the offending code is not in the theme's header.php or functions.php, it could also be a plugin which is hooking into the wp_head action and printing the script directly. Generally the quickest way to find the problem is to do a global search on the WordPress install for the string "http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js", which should yield up the offending theme/plugin.

    I have some additional information on this subject here: Troubleshooter: jQuery Version Incorrect, in case it is helpful

    All the best :)

    Chris

  9. melissa@momodigitaldesign.com
    Member
    Posted 2 months ago #

    Ok. I'll be honest. I don't really know what I'm doing when it comes to jQuery, but following along with the suggestions provided, I removed some code from my header and added in what I think may be correct.

    Removed:
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>

    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script>

    Added:
    <script type='text/javascript' src='http://www.momodigitaldesign.com/codyent/wp-includes/js/jquery/jquery.js'></script>

    Now my content is collapsed appropriately, but when I click to expand the page jumps down and the content appears. The "slide and fade" isn't working. Any further suggestions?

    Thanks so much!

  10. Baden
    Member
    Plugin Author

    Posted 2 months ago #

    First, It is good that you removed the scripts, but should also remove the line you added. The way plugins work (well written plugins, anyway) is they first check to see if jQuery has already been loaded. If not, they will load it for you (the correct version, in the correct location). if it already has been loaded, it says 'hey thanks' and moves on.

    Second, the issue with things flopping around all over the place. This is because your triggers have the following css:

    .collapseomatic {
    float: left;
    clear: both;
    width: 90%;
    ...
    }

    Try removing the float, clear and width from the triggers and placing it in a wrappign container like so:

    <div class="floatwrap">[expand title="title"]target content[/expand]</div>

    and then simply add the floatwrap class to your css:

    .floatwrap {
    float: left;
    clear: both;
    width: 90%;
    }

    Give that a try and let us know how it goes!

  11. melissa@momodigitaldesign.com
    Member
    Posted 2 months ago #

    Baden,
    Thanks for the explanation and advice. Now I get it!

    I removed the jQuery line from my header, and removed the CSS mentioned above, and now it works. I didn't need to assign that CSS to a div and wrap it.

    Thanks SO much for the help. I really appreciate it!

  12. Baden
    Member
    Plugin Author

    Posted 2 months ago #

    Happy to hear you got it sussed out! If you are happy and you know it, clap your hands!
    Issue marked as resolved.

Reply

You must log in to post.

About this Plugin

About this Topic