Setting specific min-width
and max-width
for your <nav>
menu will fix the issue:
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation" style="min-width: 1000px; max-width: 1000px;">
Here’s the JavaScript/jQuery method that will set the min-width
and max-width
of your .navbar
when the event 'affix.bs.affix'
got fired:
var navbar = jQuery('nav.navbar');
// If 'affix.bs.affix' is fired.
navbar.on('affix.bs.affix', function () {
// Set the min-width and max-width.
jQuery(this).css('min-width', navbar.width());
jQuery(this).css('max-width', navbar.width());
}
The event 'affix.bs.affix'
will fires immediately before your .navbar
has been affixed. For more info visit JavaScript · Bootstrap – Affix: Events.
Related Posts:
- Multi Level Bootstrap Navigation Menu in WordPress
- Nav walker, bootstrap: Display 3rd level items under 2nd level
- Main Menu and Sub Menu Items for Footer
- WordPress + Bootstrap: Replace primary navigation menu on mobile?
- Add custom menu item using wp_nav_menu_items filter
- how to create a menu with all sub categories?
- Add separator to admin submenu
- How show sub menu only using wp_nav_menu()
- Show only 2nd level of navigation depending on active navigation
- Bootstrap drop down menu with wp_nav_menu
- wp_nav_menu() loses ‘current-menu-*’ classes on single product page within category
- HTML Bootstrap navigation menu to WordPress menu using wp_nav_menu
- How to make pages metabox display all hierarchy in menu admin?
- Add items to a menu dynamically
- Output the aria-labelledby parameter for a nav menu child
- How can I add a sub menu to an existing navigation menu in WordPress?
- Custom Nav Walker sub-menu HTML construct
- Add div to specific sub-menu
- Adding different classes to anchor in navigation menu
- Add Bootstrap dropdown class to a nav menu
- Custom Walker for Walker_Nav_Menu
- Arrow down in menu not displaying
- Make compatible custom menu widget for Twitter Bootstrap
- Handling complex multi-level architecture / menu for large site
- Loop through Navbar, Output Icons
- Update Nav Menu Items Programmatically
- How to display dynamic content in start_lvl function
- Menus like a CMS
- How can I remove data-target=”#” from bootstrap dropdown menu?
- next_post_link() on custom menu structure
- How to add a submenu toggle button inside all “li” elements that have a submenu?
- Does loading of sub pages in menu cause load to the server?
- Show menu based on parent & ancestor
- How to include a third level with wp_get_nav_menu_items function
- Schedule Page to Menu [duplicate]
- How do you manage large menu hierarchies in WP?
- Update body class based on menu
- Trying to Create Menu in WordPress
- Hierarchical menu nesting problem with jQuery targetting
- Highlight current post ancestor parent menu items
- Add code to WordPress menu items by class
- How to customize submenus isn wordpress theme [closed]
- Can I have a different menu for each parent page?
- remove class “sub-menu” from wordpress drop down menu
- Add a submenu to wp_nav_menu
- Adding sub-menu item makes parent item unclickable
- Wrap list parent in div with wp_nav_menu menu
- WordPress + Bootstrap [closed]
- wp_nav_menu not displaying the right way
- How to buid wordpress menu with auto width sub-menu items in dropdown menu without any items sharing one line [closed]
- sub menu link is not working
- Adding toggle-able element after menu item
- wp_get_archives doesn’t take effect from css or html
- Make two bootstrap menus collapse into one dropdown
- How to Add support for sub-menu item description in wordpress?
- URL links consistent with menus?
- Replace anchor tag with span tag
- If current menu item is child or parent with child?
- Responsive menu on genesis theme [closed]
- How to check if current page is a parent item or child item in a given menu
- Removing Submenu from Menu
- Controlling sub-menu within sub-menu
- Bootstrap menu – make menu entries with submenu not clickable
- Set one or more menus as a submenus of another menu
- Custom menu with additional logic for display
- Change hover to onclick on menu
- Bootstrap Theme Migrated to WordPress
- having a page in multi sub-menu and match current-menu-item
- Why my dropdown menu is effecting main menu?
- How to create a mobile menu full screen overlay using Understraps Bootstrap 4 theme
- Bootstrap Nav Walker Sub Menu Image
- Creating navigation out of specific IDs and their children?
- Where to place a svg chevron down in my custom walker?
- Add href to tag in nav menu for mobile
- How to change navwalker’s dropdown mark-up?
- Incorrect Behavior on WordPress Main Menu
- How to access into the description of a sub menu
- Bootstrap navbar responsiveness on WordPress theme menu not working
- Importing large product categories into wordpress menu
- Adding span to a particular text in an menu item
- How to separate sub-menu output and keep associated with parent
- Has there been any improvements to wp’s menu handling?
- How to sort a sub-menu, generated with get_pages(), by the page order instead of alphabetically?
- Reveal hidden submenus on page load – Twenty Fifteen theme
- Always show wordpress submenu on responsive header menu
- Show Child of Parent Page including all other parents
- Add a Submenu from Another Submenu in a Custom Theme
- How to display list of child pages with parent in wordpress?
- nav_menu: how to force a subpage switching on the parent menu
- Use menu structure for permalinks
- Adding two submenus to a menu
- Add tooltips with image in WordPress Menu?
- Building Menus with the latest posts included
- How to add drop down sub menu from database fields in the particular menu slug
- collapse twenty twelve submenu in mobile version
- wp_nav_menu changed to wp_page_menu
- Should I custom code drop down menus or use a wordpress plugin?
- WordPress menu is getting automatically nested
- Convert a custom bootsrap based menu to wordpress nav walker
- Add acf custom fields so sub item in menus