[Solved] jQuery Menu Broken

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
Post Reply
apollo9
Forum Members
Forum Members
Posts: 22
Joined: Sat Nov 09, 2013 3:10 pm

[Solved] jQuery Menu Broken

Post by apollo9 »

Our site is being updated, and as a result of using a newer version of jQuery, 1.9+, the existing accordion menu has broken.
My best guess is that it's to do with .slideToggle command.
Does anyone know how to fix this because I'm stuck?

Code: Select all

<__script__ type="text/javascript">
        		$(document).ready(function(){ 
   $('ul.menu ul').hide();
   $('ul.menu').find("li.selected").parent().show();
   $('ul.menu').find("li.selectedparent").parent().show();
   $('ul.menu li a').not('ul ul a').click(
      function() {
         var checkElement = $(this).next();
         var parent = this.parentNode.parentNode.id;
         if($('#' + parent).hasClass('noaccordion')) {
            if((String(parent).length > 0) && (String(this.className).length > 0)) {
               $(this).next().slideToggle('normal');
            }
         }
         if((checkElement.is('ul')) && (checkElement.is(':visible'))) {
            if($('#' + parent).hasClass('collapsible')) {
               $('#' + parent + ' ul:visible').slideUp('slow');
            }
            return false;
         }
         if((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
            $('#' + parent + ' ul:visible').slideUp('slow');
            checkElement.slideDown('slow');
            return false;
         }

      }
   );
})
        </__script>
Last edited by apollo9 on Sun Apr 12, 2015 5:28 pm, edited 1 time in total.
User avatar
paulbaker
Dev Team Member
Dev Team Member
Posts: 1465
Joined: Sat Apr 18, 2009 10:09 pm
Contact:

Re: jQuery Menu Broken

Post by paulbaker »

URL would probably help here. And define what you mean by broken - doesn't work at all? Some aspect doesn't do what it used to do? What updating to the site is being done...CMSMS version update? More clues = more chance of solution.
To copy System Information to the forum:
https://docs.cmsmadesimple.org/troubles ... nformation

CMS Made Simple Geekmoots attended:
Nottingham, UK 2012 | Ghent, Belgium 2015 | Leicester, UK 2016
apollo9
Forum Members
Forum Members
Posts: 22
Joined: Sat Nov 09, 2013 3:10 pm

Re: jQuery Menu Broken

Post by apollo9 »

This is how the menu currently works. (The old site is still live until the new one is working). cmsms 1.11.9. jquery 1.7.2.
http://cornworthy.com/cms

The new site is running 1.11.13 and if I use jquery 1.9.0 or higher the menu fails to open and close when clicked.
http://cornworthy.com.gridhosted.co.uk/cms/

I've updated other scripts which is why I'm using a different jquery version.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: jQuery Menu Broken

Post by calguy1000 »

HINT1: View your javascript console and resolve errors. Then see what other stuff is broken.

HINT2: Read the jquery 1.9 upgrade guide.

[edit]
HINT3: Get your HTML to validate.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
apollo9
Forum Members
Forum Members
Posts: 22
Joined: Sat Nov 09, 2013 3:10 pm

Re: jQuery Menu Broken

Post by apollo9 »

Thanks for the suggestions. Think I'm out of my depth here - will take another look.
apollo9
Forum Members
Forum Members
Posts: 22
Joined: Sat Nov 09, 2013 3:10 pm

Re: jQuery Menu Broken

Post by apollo9 »

It was colorbox causing the problem! Also needed an update.
Thanks again.
Post Reply

Return to “The Lounge”