Bootstrap Horizontal Navbar Toggle - toggle

I prepared simple navbar menu with BS 4 documents. The toggle menu displays vertical when I clicked. Is it possible make horizontal with BS?
This is my navbar and codepen.io: vertical toggle
body {
margin: 0 auto;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"></script>
<nav class="navbar navbar-expand-md navbar-dark bg-dark">
<a class="nav-brand" href="#">
<img class="img-responsive" src="https://cdn2.iconfinder.com/data/icons/camping-outline-flat-pt-2/100/069_-_snowboard_snowboarding_board_1-128.png" width="55" height="55" alt="logo">
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#mainNav">
<span class="navbar-toggler-icon"</span>
</button>
<div class="collapse navbar-collapse" id="mainNav">
<div class="navbar-nav ml-auto">
<a class="nav-item nav-link active" href="#">ABOUT<span class="sr-only">(current)</span></a>
<a class="nav-item nav-link " href="#">PORTFOLIO</a>
<a class="nav-item nav-link " href="#">CONTACT</a>
</div>
</div>
</nav>
This is as I want but I couldn't figured out with source code: horizontal toggle

It's fairly simple to do that. Bootstrap has flex class options, so there's no need to create your own code.
Simply change:
<div class="navbar-nav ml-auto">
To:
<div class="navbar-nav flex-row ml-md-auto d-md-flex">
Also make sure to add p-2 to your nav-item that will give you some padding space between the elements.
That makes your code look like this:
<nav class="navbar navbar-expand-md navbar-dark bg-dark">
<a class="nav-brand" href="#">
<img class="img-responsive" src="https://cdn2.iconfinder.com/data/icons/camping-outline-flat-pt-2/100/069_-_snowboard_snowboarding_board_1-128.png" width="55" height="55" alt="logo">
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#mainNav">
<span class="navbar-toggler-icon"</span>
</button>
<div class="collapse navbar-collapse" id="mainNav">
<div class="navbar-nav flex-row ml-md-auto d-md-flex">
<a class="nav-item nav-link p-2 active" href="#">ABOUT<span class="sr-only">(current)</span></a>
<a class="nav-item nav-link p-2" href="#">PORTFOLIO</a>
<a class="nav-item nav-link p-2" href="#">CONTACT</a>
</div>
</div>
</nav>

Related

how to change the color of hamburger icon in bootstrap 5

<nav class="navbar navbar-expand-lg">
<img class="nav-img" src="images/amd-white.svg" alt="">
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="#navbarSupportedContent">
<a class="navbar-brand" href=""></a>
<div class="nav2"></div>
<ul class="navbar-nav">
<div class="nav2">
<li class="nav-item">
<div class="dropdown show">
<a class="btn btn-secondary dropdown-toggle" href="#" role="button" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
PRODUCT
</a>
<div class="dropdown-menu" aria-labelledby="dropdownMenuLink">
<a class="dropdown-item" href="#">Action</a>
<a class="dropdown-item" href="#">Another action</a>
<a class="dropdown-item" href="#">Something else here</a>
</div>
</div>
</li>
</div>
<div class="nav2">
<li class="nav-item">
<div class="dropdown show">
<a class="btn btn-secondary dropdown-toggle" href="#" role="button" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
SOLUTION
</a>
<div class="dropdown-menu" aria-labelledby="dropdownMenuLink">
<a class="dropdown-item" href="#">Action</a>
<a class="dropdown-item" href="#">Another action</a>
<a class="dropdown-item" href="#">Something else here</a>
</div>
</li>
</div>
<div class="nav2">
<li class="nav-item">
<div class="dropdown show">
<a class="btn btn-secondary dropdown-toggle" href="#" role="button" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
SHOP
</a>
<div class="dropdown-menu" aria-labelledby="dropdownMenuLink">
<a class="dropdown-item" href="#">Action</a>
<a class="dropdown-item" href="#">Another action</a>
<a class="dropdown-item" href="#">Something else here</a>
</div>
</li>
</div>
<div class="nav2">
<li class="nav-item">
<div class="driver">DRIVERS & SUPPORT</div>
</li>
</div>
</ul>
</div>
What I understood from your question, You can add these bg classes to toggler button and the icon span to change its color, like this:
<button class="navbar-toggler ml-auto bg-danger"
type="button"
data-toggle="collapse"
data-target="#nav1">
<span class="navbar-toggler-icon my-toggler bg-info">
</span>
</button>

Bootstrap - drop downs no longer working online but works perfect in VS Code Live Server

I uploaded my website to a new host, Web Host Canada. I downloaded all the files from the previous host, Hostpapa.ca and then uploaded to the new Host but now the dropdown menus are not working.
www.FeaterX.com
However, in VS-Code Live Server everything is working perfectly.
here is the coding I did for the Navbar
<!-- Featerx nav bar-->
<nav class="navbar navbar-expand-lg navbar-dark bg-transparent no-gutters pb-5 sticky-top trn">
<a class="navbar-brand" href="index.html">
<div class="header-title">
<h4 class="text-center text-light">FeaterX International</h4>
<h6 class="text-center text-light">- est. 1994 -</h6>
</div></a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavDropdown" aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse ml-5" id="navbarNavDropdown">
<ul class="navbar-nav">
<li class="nav-item active">
<a class="nav-link text-warning" href="http://thekingslandingresort.ca/">
<h5 class="text-center">The King's Landing Luxury RV Resort</h5>
</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle text-warning" href="#" id="navbarDropdownMenuLinkConsulting" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<h5 class="text-center"> FX<em>i</em>-Consulting</h5>
</a>
<div class="dropdown-menu bg-light" aria-labelledby="navbarDropdownMenuLink">
<a class="dropdown-item text-dark" href="FXi_Consulting.html">
<h4 class="text-left">FX<em>i</em>-Consulting</h4>
</a>
<a class="dropdown-item text-dark" href="FXi_JobSite_Solutions.html">
<h4 class="text-left">FX<em>i</em>-JobSite Solutions</h4>
</a>
<a class="dropdown-item text-dark" href="FXi_Learning.html">
<h4 class="text-left">FX<em>i</em>-Learning</h4>
</a>
</div>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle text-warning" href="#" id="navbarDropdownMenuLink2" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<h5 class="text-center"> Great Reads</h5>
</a>
<div class="dropdown-menu bg-light" aria-labelledby="navbarDropdownMenuLink">
<a class="dropdown-item text-dark" href="FeaterX_Articles_Books_Blogs_etc.html">
<h4 class="text-left">Articles</h4>
</a>
<a class="dropdown-item text-dark" href="FeaterX_Books.html">
<h4 class="text-left">Books</h4>
</a>
<!-- <a class="dropdown-item text-dark" href="FeaterX_Articles_Books_Blogs_etc.html">
<h4 class="text-left">Social Media</h4>
</a> -->
</div>
</li>
</ul>
</div>
<div class="row no-gutters navbutton d-none d-lg-inline">
<div class="col nav-item">
<a class="nav-link" href="Contact.html"> <button type="button" class="btn btn-danger btn-sm">
Contact
</button>
</a>
<a class="LinkedIn" href="https://www.linkedin.com/in/roy-cooper-5b9b3988/">
<img src="images/LI-China-Logo.png" alt="Linked In logo with both english and cantonese characters" class="img-fluid">
</a>
</div>
</div>
</nav>
any thoughts on how to fix this?
Your scripts are not loading. They are missing. Recheck their path:
After your first comment I tested again, and now the protocol HTTP/3 has changed to HTTP/2 but still missing the files. Maybe a permissions problem?
This is the new browser console result:

where should glyphicon code be inserted

Fist of all I am new to css/javascript/bootstrap.
All I want is to place this code:
<i class="fi-guide-dog"></i>
inside my span (or somewhere) so the dog icon shows next to the "Dog" word.
Please find my code below:
{%load static%}
<link rel="stylesheet" type="text/css" href="{% static 'toarnatot/style.css' %}" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle= "collapse" data-target ="#topnavbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href={%url 'toarnatot:home'%}><strong>ToarnaTot</strong></a>
</div>
<!-- items -->
<div class="collapse navbar-collapse">
<ul class ="nav navbar-nav">
<li class="">
<a href="{% url 'toarnatot:home'%}">
<span class="glyphicon glyphicon-something" aria-hidden="true">
Dog
</span>
</a>
</li>
</ul>
</div>
</div>
</nav>
Do not put anything inside the span tag , instead create another tag to print the text that you want to display with the glyphicon.
like:
<p>dog</p>
<span class="glyphicon glyphicon-something" aria-hidden="true"></span>

Popover in ionic framework

I am trying to create a popup in my ionic view.
<div class="item tabs tabs-secondary tabs-icon-left">
<a class="tab-item" href="#">
<i class="icon ion-thumbsup"></i> Like
</a>
<a class="tab-item" href="#">
<i class="icon ion-chatbox"></i> Comment
</a>
<a class="tab-item">
<i class="icon ion-share"></i> Share
</a>
</div>
When i click on Share button , I should get the below template as popup.. not as separate view.
<div class="popover-mask"></div>
<div class="popover popover--down" style="top: 20px; left: 165px;">
<div class="popover__top-arrow"></div>
<div class="popover__content">
<ul class="list">
<li class="item">Facebook
</li>
<li class="item">Twitter
</li>
</ul>
</div>
</div>
How to do it?
Thanks,
Sabarisri
create a share button:
<div class="buttons">
<button class="button button-icon ion-more" ng-click="popover.show($event)"></button>
</div>
put your popover template like this:
<script id="templates/popover.html" type="text/ng-template">
<ion-popover-view>
<ion-content>
<div class="popover-mask"></div>
<div class="popover popover--down" style="top: 20px; left: 165px;">
<div class="popover__top-arrow"></div>
<div class="popover__content">
<ul class="list">
<li class="item">Facebook
</li>
<li class="item">Twitter
</li>
</ul>
</div>
</div>
</ion-content>
</ion-popover-view>
</script>
in your controller call the popover like this:
$ionicPopover.fromTemplateUrl('templates/popover.html', {
scope: $scope,
}).then(function(popover) {
$scope.popover = popover;
});

My angular strap navbar will not expand

I am using angular-strap to create a navbar. It collapses down to the hamburger icon just like it should, but when it is collapsed (hamburger icon) it will not expand to click on a link. Here is my code:
<nav class="navbar navbar-default" role="navigation" bs-navbar>
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Brand</a>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li class="active">Link</li>
<li>Link</li>
</ul>
</div>
</div>
</nav>
The navbar is responsive like expected. Also, the directive is being instantiated, because the breakpoint in the link function gets hit. As explained above when the navbar is in it's hamburger state, it won't expand to make it able to click on any of the links. What else do I need to look at to make this work with angular-strap? How do I make the hamburger icon expand?
You can make use of the collapse directive in ng-strap 2.1.3.
This was added very recently.
An example:
<nav class="navbar navbar-default" bs-collapse>
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" bs-collapse-toggle>
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" ng-bind="config.options.page.pageName" ui-sref="root">Doks</a>
</div>
<div bs-collapse-target>
<ul class="nav navbar-nav">
<li ng-repeat="category in categories" class="item" ng-class="{active: urlParams.category === category}">
<a ui-sref="hasCategory({category: category})">{{category}}</a>
</li>
</ul>
</div>
</div>
</nav>