Foundation Top-Bar Nav not opening on Mobile View
Permalink
Hi I have built a theme using foundation 5, currently having problems with my navigation.
It happens on a mobile device. When on home page and you click on the menu it opens properly, if you go to any of the top and second level pages (for example About Us or Contact Us) and then click on the menu again. It does not open. It does open if you are on a third level page.
What I don't understand is that it works on some pages and not on others.
Can anyone have a look and see what might be the problem
gatsbyproductions.co.za/dev/
Below is the code I used in the auto nag template.
It happens on a mobile device. When on home page and you click on the menu it opens properly, if you go to any of the top and second level pages (for example About Us or Contact Us) and then click on the menu again. It does not open. It does open if you are on a third level page.
What I don't understand is that it works on some pages and not on others.
Can anyone have a look and see what might be the problem
gatsbyproductions.co.za/dev/
Below is the code I used in the auto nag template.
<?php defined('C5_EXECUTE') or die("Access Denied."); $navItems = $controller->getNavItems(); $c = Page::getCurrentPage(); foreach ($navItems as $ni) { $classes = array(); if ($ni->inPath) { $classes[] = 'nav-path-selected'; } if ($ni->hasSubmenu) { $classes[] = 'has-dropdown'; } $ni->classes = implode(" ", $classes); } echo '<nav class="top-bar" data-topbar role="navigation">'; echo ' <ul class="title-area">';
Viewing 15 lines of 37 lines. View entire code block.
Does anyone have any ideas?
Hi,
it seems your theme is not loading jQuery.
The menu is working on your homepage because the image slider is loading jQuery, but it's not working on the other pages because jQuery is not included.
In concrete 5.7 jQuery is not loaded by default. You need to add the following code to your page_theme.php file if you want to include jQuery:
More information:
http://www.concrete5.org/documentation/developers/5.7/designing-for...
HOpe this helps,
JOrdi
it seems your theme is not loading jQuery.
The menu is working on your homepage because the image slider is loading jQuery, but it's not working on the other pages because jQuery is not included.
In concrete 5.7 jQuery is not loaded by default. You need to add the following code to your page_theme.php file if you want to include jQuery:
public function registerAssets() { $this->requireAsset('javascript', 'jquery'); }
More information:
http://www.concrete5.org/documentation/developers/5.7/designing-for...
HOpe this helps,
JOrdi
Thanks so much for your response. Including the javascript worked.