MrPurplz
Forum Replies Created
-
Forum: Plugins
In reply to: [Advanced AJAX Page Loader] Navigation bar isn't unhighlightingIt seems it’s not firing the first time. The code to collapse the navigation bar only works the second time you click it. This may have something to do with this issue.
I’ve tried disabling all plugins apart from this one but the same issue happens.
Could really do with any insight!
Forum: Themes and Templates
In reply to: [Theme: Twenty Fourteen] How to close navigation bar onclick?One small bug with this, the code you gave me works fine apart from the first time it’s pressed. It doesn’t untoggle the first time something is selected but afterwards it toggles fine. Do you know why this might be?
Forum: Themes and Templates
In reply to: [Theme: Twenty Fourteen] How to close navigation bar onclick?Thanks for all your help ??
Forum: Themes and Templates
In reply to: [Theme: Twenty Fourteen] How to close navigation bar onclick?‘Advanced AJAX Page Loader’
Forum: Themes and Templates
In reply to: [Theme: Twenty Fourteen] How to close navigation bar onclick?It’s not the plugin files, it’s the plugins settings within the dashboard
I’m not sure the ‘CSS Javascript Toolbox’ would have any further effect due the other code in the box, for toggling the nav bar, is working.
Forum: Themes and Templates
In reply to: [Theme: Twenty Fourteen] How to close navigation bar onclick?I’m not sure.
The code you provided I added underneath the code I posted in the last post. I assume that code is supposed to unhighlight the previous link on the navigation bar but isn’t working correctly. That section is ‘firing’ right as the code you provided is now working correctly.
Should that code, in theory, be working correctly and unhighlighting the nav bar?
Forum: Themes and Templates
In reply to: [Theme: Twenty Fourteen] How to close navigation bar onclick?Some of the JS already provided by the plugin looks like it’s supposed to update the menu bar
// highlight the current menu item jQuery('ul.menu li').each(function() { jQuery(this).removeClass('current-menu-item'); }); jQuery(thiss).parents('li').addClass('current-menu-item');
So it seems it might be an issue with the plugin?
EDIT: Ignore all this. I got it working. Thank you so much! Now I just have one final issue.
When I select something else from the navigation bar, it does highlight the correct one, but doesn’t unhighlight the previous
Looking at the above code, isn’t that what
jQuery(this).removeClass('current-menu-item');
should be doing?
Forum: Themes and Templates
In reply to: [Theme: Twenty Fourteen] How to close navigation bar onclick?Thanks man, the plugin does support JS modification but that code block doesn’t seem to work.
Apologies, I’m terrible at coding, I thank you for your time though. The AJAX is also not updating the navigation bar to highlight the selected page (stays on the initial page) so I think I’m going to have to work out another way of doing this.
Forum: Themes and Templates
In reply to: [Theme: Twenty Fourteen] How to close navigation bar onclick?Ah, apologies, I’m using a plugin for the AJAX loading!
I have found the toggled-on code in the function.js file but I’m really not sure how to write code that removes this on click.
Forum: Themes and Templates
In reply to: [Theme: Twenty Fourteen] How to close navigation bar onclick?That doesn’t appear to be there. Here is the nav code from the header. Can I add something in here to make it close on clicking a link?
<nav id="primary-navigation" class="site-navigation primary-navigation" role="navigation"> <button class="menu-toggle"><?php _e( 'Primary Menu', 'twentyfourteen' ); ?></button> <a class="screen-reader-text skip-link" href="#content"><?php _e( 'Skip to content', 'twentyfourteen' ); ?></a> <?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => 'nav-menu' ) ); ?> </nav> </div>