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?
- Nav walker bootstrap: Display 3rd level and 4th level in dropdown menu
- Display a portion/ branch of the menu tree using wp_nav_menu()
- Add custom menu item using wp_nav_menu_items filter
- how to create a menu with all sub categories?
- Add separator to admin submenu
- Display only page specific sub menu items using Custom Walker
- adding some custom html code to the wp_nav_menu function
- Add a .last class to the last in each ul.sub-menu
- Add class to top level menu item if it has multiple child levels
- How show sub menu only using wp_nav_menu()
- Show only 2nd level of navigation depending on active navigation
- How do I add the data-toggle=”modal” data-target=”#myModal” attribures to a WP Nav bar?
- Simple Navigation Walker – Wrapper-class around first sub-menu
- Bootstrap drop down menu with wp_nav_menu
- How to get a separate child menu?
- wordpress nav menu using twitter bootstrap
- Exclude one item from wp_list_pages( $args );
- 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 drag multiple menu items at once in WordPress?
- Customizing the a tag with Semantic UI
- Put a wp_nav_menu inside another one
- How to make pages metabox display all hierarchy in menu admin?
- Add items to a menu dynamically
- Generate a Menu that displays all child pages of top level parent
- 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
- Check if wp_nav_menu items have submenus
- Add div to specific sub-menu
- Automatically Add New Tags to Sub-menu
- Adding different classes to anchor in navigation menu
- Add Bootstrap dropdown class to a nav menu
- how to only add a top-level admin menu without it creating a sub-level-menu
- how to automatically generate hierarchical menus from hierarchy of pages?
- Custom Walker for Walker_Nav_Menu
- Arrow down in menu not displaying
- Programmatically adding menu items function replicates in multiple menus
- Make compatible custom menu widget for Twitter Bootstrap
- Handling complex multi-level architecture / menu for large site
- Sub-Pages only of menu items in current branch using a custom menu
- Loop through Navbar, Output Icons
- Update Nav Menu Items Programmatically
- How to display dynamic content in start_lvl function
- wp_list_pages: only show subpages on the parent page?
- Menus like a CMS
- How to have custom menu Item CSS Classes for wp_page_menu() or wp_list_pages()
- How can I remove data-target=”#” from bootstrap dropdown menu?
- next_post_link() on custom menu structure
- Make menu bootstrap compatible
- WordPress sub-menu items suddenly not showing
- How to add a submenu toggle button inside all “li” elements that have a submenu?
- No “current-menu-ancestor” class added when browsing an archive page
- How to construct a custom html for submenus
- Check if menu id = $specific_id – then insert specific
- Does loading of sub pages in menu cause load to the server?
- Show menu based on parent & ancestor
- How to add class to and childs of sidebar widget – WordPress
- How to include a third level with wp_get_nav_menu_items function
- How to have two menus using Bootstrap nav walker?
- wp_nav_menu() with multiple Class
- Schedule Page to Menu [duplicate]
- How do you manage large menu hierarchies in WP?
- Update body class based on menu
- add_submenu_page function to show videos table
- Trying to Create Menu in WordPress
- How do I add recent posts to the menu?
- How to add ID attribute to each submenu?
- Side Menu Icon Expandable
- Hierarchical menu nesting problem with jQuery targetting
- From a page, is it possible to find entry’s “menu_item_parent”?
- Automatically list top level menu item child pages
- Highlight current post ancestor parent menu items
- How to retrieve parent menu item name of current submenu item
- Check if menu_item has children or has parent
- Add code to WordPress menu items by class
- WordPress Walker – Group two items?
- Creating a menu containing categories and authors
- Change submenu markup
- getting the current sub item out of total sub items in a given dropdown (custom walker)
- Show WordPress Menu On External Site
- Sticky Header in WordPress using BootstrapWP theme [closed]
- How to customize submenus isn wordpress theme [closed]
- Switch from hover to click on Twenty Twelve Menu
- a better menu, menu options assistance for WP
- How to highlight 1st level menu item based on actual page
- 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
- Insert a div class inside wordpress menu
- Bootstrap button menu on wordpress
- Add Labels to Admin Menu ( How To )