Support » Plugin: Collapse-O-Matic » Content only expanded (other threads not helping)

Viewing 11 replies - 1 through 11 (of 11 total)
  • What is your “Animation Effect:” on the Options page set to?

    Thread Starter melissa@momodigitaldesign.com

    (@melissamomodigitaldesigncom)

    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!

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

    Plugin Author Baden

    (@baden03)

    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?

    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

    Plugin Author Baden

    (@baden03)

    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.

    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&#8221;, 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

    Thread Starter melissa@momodigitaldesign.com

    (@melissamomodigitaldesigncom)

    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&gt;

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

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

    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!

    Plugin Author Baden

    (@baden03)

    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!

    Thread Starter melissa@momodigitaldesign.com

    (@melissamomodigitaldesigncom)

    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!

    Plugin Author Baden

    (@baden03)

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

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Content only expanded (other threads not helping)’ is closed to new replies.