Digital experiences for all disciplines
New Landing › How can we help? › Atelier › Open/Close submenu in Side Slideout Menu
New Landing › How can we help? › Atelier › Open/Close submenu in Side Slideout Menu
- This topic has 9 replies, 3 voices, and was last updated 8 years by David Martin – Support.
-
Posted in: Atelier
-
July 12, 2016 at 1:15 pm #280733
Hi,
I want to change the behavior of the Side Slideout Menu when a sub menu is open, when I click a menu with submenu, the main menu changes the arrow icon from “to bottom” to “up”, I want to click in the “up arrow” icon and instead of going to the main menu link, close the submenu list.
How can I do that?
Thanks
July 14, 2016 at 8:01 pm #281354Hi,
If you open functions.js. Locate this:
// Mobile Menu parent click jQuery('#mobile-menu li > a').on('click', function(e) { var parentMenuItem = jQuery(this).parent(), linkHref = jQuery(this).attr('href'), subMenu = parentMenuItem.find('ul.sub-menu').first(); if (!parentMenuItem.hasClass('parent')) { SWIFT.nav.mobileMenuHideTrigger(); if (linkHref.indexOf('#') === 0 && linkHref.length > 1) { SWIFT.isScrolling = true; SWIFT.page.onePageNavGoTo(linkHref); setTimeout(function() { SWIFT.isScrolling = false; }, 1000); e.preventDefault(); } else if (body.hasClass('page-transitions')) { SWIFT.page.fadePageOut(linkHref); } return e; } if (parentMenuItem.hasClass('sub-menu-open')) { if (linkHref.indexOf('http') === 0 || linkHref.indexOf('/') === 0) { return e; } else { parentMenuItem.removeClass('sub-menu-open'); subMenu.slideUp(); e.preventDefault(); } } else { parentMenuItem.addClass('sub-menu-open'); subMenu.slideDown(); e.preventDefault(); } });
Then replace with this:
// Mobile Menu parent click jQuery('#mobile-menu li > a').on('click', function(e) { var parentMenuItem = jQuery(this).parent(), linkHref = jQuery(this).attr('href'), subMenu = parentMenuItem.find('ul.sub-menu').first(); if (!parentMenuItem.hasClass('parent')) { SWIFT.nav.mobileMenuHideTrigger(); if (linkHref.indexOf('#') === 0 && linkHref.length > 1) { SWIFT.isScrolling = true; SWIFT.page.onePageNavGoTo(linkHref); setTimeout(function() { SWIFT.isScrolling = false; }, 1000); e.preventDefault(); } else if (body.hasClass('page-transitions')) { SWIFT.page.fadePageOut(linkHref); } return e; } if (parentMenuItem.hasClass('sub-menu-open')) { subMenu.slideUp(); e.preventDefault(); parentMenuItem.removeClass('sub-menu-open'); if (linkHref.indexOf('http') === 0 || linkHref.indexOf('/') === 0) { return e; } else { parentMenuItem.removeClass('sub-menu-open'); subMenu.slideUp(); e.preventDefault(); } } else { parentMenuItem.addClass('sub-menu-open'); subMenu.slideDown(); e.preventDefault(); } });
Disabled the Load pre-minified scripts from within Theme Options => General Options.
August 4, 2016 at 7:42 pm #285949Not working for me.
came to :
htdocs/wp-content/themes/atelier/js
modify and replaceAugust 4, 2016 at 7:47 pm #285953You also must do this:
Disabled the Load pre-minified scripts from within Theme Options => General Options.
August 4, 2016 at 7:54 pm #285957Yes I did
August 4, 2016 at 8:01 pm #285959Will need to check your implementation. Please add your FTP details.
August 5, 2016 at 12:34 am #285978This is the functions.js
Attachments:
You must be logged in to view attached files.August 5, 2016 at 9:42 am #286028Will need a URL/FTP details.
Thanks.
August 5, 2016 at 8:49 pm #286131If I’m dropping the info in private here, are you the only on to read it or the creator of this topic can read it too?
August 8, 2016 at 10:40 am #286247As this is not your own thread, please open a new thread.
You can set a different menu to mobile. So without even needing the above JS you can simply set the parent link to a custom link
#
rather than a full URL. This will automatically open/close as you need.Thanks.
-
Posted in: Atelier
You must be logged in and have valid license to reply to this topic.