Showing notification window in mobile view - html

in my app, i have a notification popup window that shows the latest messages, my example does not show opening, but that isnt the main of the conversation, the problem is that wwhen i resize the window, by button link with the bell notification on the right disapears, when it should be showing always, even in mobile.
The toggle menu appears has should it be, but in mobile view the bell link menu notifcation should appear at his side.
Whats wrong with my html code? Im using bootstrap
Ex:https://codepen.io/anon/pen/mmxQwO?editors=1010
Html:
<!-- Static navbar -->
<nav class="navbar navbar-default navbar-static-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<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="#">Project name</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li class="active">Home</li>
<li>About</li>
<li>Contact</li>
<li class="dropdown">
Dropdown <span class="caret"></span>
<ul class="dropdown-menu">
<li>Action</li>
<li>Another action</li>
<li>Something else here</li>
<li role="separator" class="divider"></li>
<li class="dropdown-header">Nav header</li>
<li>Separated link</li>
<li>One more separated link</li>
</ul>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li class="dropdown ng-isolate-scope">
<a id="dLabel" role="button" class="icon-wrapper" data-toggle="dropdown" ng-click="notificationCtrl.updateDateTime()" data-target="#">
<i class="fa fa-bell-o"><span class="badge-notification ng-binding ng-hide" ng-show="notificationCtrl.nrNotifications > 0"> 0</span></i>
<div class="clearfix"></div>
</a>
<ul class="dropdown-menu notifications" role="menu" aria-labelledby="dLabel">
<li class="dropdown-header">
Notificações
</li>
<div class="notifications-wrapper">
<!-- ngRepeat: notification in notificationCtrl.notifications | limitTo: 5 --><a ng-repeat="notification in notificationCtrl.notifications | limitTo: 5 " class="content ng-scope" href="">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 notification-grid item-title notification-item">
<div class="col-lg-10 col-md-10 col-sm-10 col-xs-10 notification-grid">
<!-- USER -->
<strong class="ng-binding"></strong>
<!-- ngIf: notification.operation == 'first_register' -->
<!-- NOTIFICAÇÔES -->
<div>
<i class="fa fa-clock-o"><span class="item-info ng-binding"> há 2 meses atrás</span></i>
</div>
</div>
</div>
</a><!-- end ngRepeat: notification in notificationCtrl.notifications | limitTo: 5 --><a ng-repeat="notification in notificationCtrl.notifications | limitTo: 5 " class="content ng-scope" href="">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 notification-grid item-title notification-item">
<div class="col-lg-10 col-md-10 col-sm-10 col-xs-10 notification-grid">
<!-- USER -->
<i class="fa fa-clock-o"><span class="item-info ng-binding"> há 2 meses atrás</span></i>
</div>
</div>
</div>
</a>
</div>
</ul>
</li>
</ul>
</div><!--/.nav-collapse -->
</div>
</nav>

Related

Embed Bootstrap 3 navbar in header

In bootstrap I want to create a page header which consists of a static header, a navbar in a second row and a profile picture to the right, like this:
The profile picture should be of fixed size, the title and nav bars should have the same size each and should fill the screen width.
Problem is, I got no clue how to achieve this in css, especially sind it needs to embed a bootstrap navbar. My only idea would be an old-fashioned 2x2 table where the picture spans two rows, but tables are not meant for layout problems, so sure there must be some better way in css?
To show full effect Watch full-screen view.
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<div class="">
<div class="row">
<div class="col-md-11">
<nav class="navbar navbar-default navbar-fixed-top" style="border-radius: 5px 5px 0px 0px; border-bottom: none; border-right: 1px solid #e7e7e7; width: 91.5%">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<a class="navbar-brand" href="#">Brand</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
</div>
<!-- /.container-fluid -->
</nav>
<nav class="navbar navbar-default" style="margin-top: 50px; border-radius: 0px 0px 5px 5px; border-top: none">
<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"
aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li >
<a href="#">Link
<span class="sr-only">(current)</span>
</a>
</li>
<li>
Link
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Dropdown
<span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li>
Action
</li>
<li>
Another action
</li>
<li>
Something else here
</li>
<li role="separator" class="divider"></li>
<li>
Separated link
</li>
<li role="separator" class="divider"></li>
<li>
One more separated link
</li>
</ul>
</li>
</ul>
<form class="navbar-form navbar-left">
<div class="form-group">
<input type="text" class="form-control" placeholder="Search">
</div>
<button type="submit" class="btn btn-default">Submit</button>
</form>
<ul class="nav navbar-nav navbar-right">
<li>
Link
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Dropdown
<span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li>
Action
</li>
<li>
Another action
</li>
<li>
Something else here
</li>
<li role="separator" class="divider"></li>
<li>
Separated link
</li>
</ul>
</li>
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container-fluid -->
</nav>
</div> <div class="col-md-1">
<div style="background-color: #f0f0f0; margin-left: -30px; padding-left: 10px; position: fixed">
<img src="https://cdn4.iconfinder.com/data/icons/dragon/512/User.png" alt="" class="" style="width:100px; margin-left: 10px ">
</div>
</div>
</div>
<!--/.row-->
<div style="height: 100vh;"></div>
</div>
<!--/.container-fluid-->
Use bootstrat 3's media styling
In this snippet I used only 1 embedded BS Nav and added a border color to delineate the media objects
ALSO - Bootstrap navs are responsive so when you run the snippet switch to expanded view
.media {
border: 1px solid gray;
}
.media, .media-body {
overflow: visible !important;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<div class="row">
<div class="col-sm-offset-2 col-sm-8">
<div class="media">
<div class="media-body">
<h4 class="media-heading">Media heading</h4>
<div>
<nav class="navbar navbar-default">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<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>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li class="active">Link <span class="sr-only">(current)</span></li>
<li>Link</li>
<li class="dropdown">
Dropdown <span class="caret"></span>
<ul class="dropdown-menu">
<li>Action</li>
<li>Another action</li>
<li>Something else here</li>
<li role="separator" class="divider"></li>
<li>Separated link</li>
<li role="separator" class="divider"></li>
<li>One more separated link</li>
</ul>
</li>
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container-fluid -->
</nav>
</div>
</div>
<div class="media-right">
<a href="#">
<img class="media-object" src="http://via.placeholder.com/80x80" alt="Portrait">
</a>
</div>
</div>
<div class="media">
<div class="media-body">
<h4 class="media-heading">Media heading</h4>
<nav>Nav</nav>
</div>
<div class="media-right">
<a href="#">
<img class="media-object" src="http://via.placeholder.com/80x80" alt="Portrait">
</a>
</div>
</div>
<div class="media">
<div class="media-body">
<h4 class="media-heading">Media heading</h4>
<nav>Nav</nav>
</div>
<div class="media-right">
<a href="#">
<img class="media-object" src="http://via.placeholder.com/80x80" alt="Portrait">
</a>
</div>
</div>
</div>
</div>

<li> items appearing in same line in Mobile version

I have this issue when the viewport switches to a mobile version
using bootstrap v3
when the navbar switches to the mobile version of itself , the 2nd and the 3rd element come on the same line , because they have a dropdown class under them.
as shown in the picture. img1 img2
if the drowpdown class isnt put then the elements show themselves properly
any help here?
<div class="navbar-header ">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<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="index.html">
<img class="img-responsive" src="images/logo/logo.png" alt="Deccan Airsports Logo">
</a>
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav navbar-right">
<li class="scroll">
Home
</li>
<li class="scroll dropdown">
Hot Air Balloon <span class="caret hidden-sm hidden-xs"> </span>
<div class="dropdown-content hidden-sm hidden-xs">
Book A Ride
Membership
FAQs
</div>
</li>
<li class="scroll dropdown">
Services<span class="caret hidden-sm hidden-xs"></span>
<div class="dropdown-content hidden-sm hidden-xs">
Gliders
Sky-Diving
Drones
Hang-Gliders
</div>
</li>
<li class="scroll">Contact</li>
<li><a class="scroll" href="about.html">About</a></li>
<li><a class="scroll" href="faq.html">FAQs</a></li>
<li class="scroll dropdown">Events<span class="caret "></span>
<div class="dropdown-content hidden-sm hidden-xs">
News & Press
Branding
Advertisement
</div>
</li>
</ul>
</div>
</div>
</div>
</div>
</header>
The issue might be with your "dropdown" class - make sure it doesn't have display:inline.

Bootstrap 3 navbar separated collapsed menu items and non-collapsed

I'm trying to have "separated" menu items when the navbar is collapsed...
Here's what I tried so far but it doesn't look right when the navbar is not collapsed because the navbar will overflow to two rows:
<nav class="navbar navbar-default navbar-static-top" ng-controller="NavbarCtrl">
<div class="container">
<div class="navbar-header">
<button class="navbar-toggle" type="button" ng-click="isCollapsed = !isCollapsed" data-toggle="collapse"
data-target="#navbar-main">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<img src="favicon-32.png">
</div>
<div collapse="isCollapsed" class="navbar-collapse collapse" id="navbar-main">
<ul class="nav navbar-nav hidden-xs">
<li ng-repeat="item in menu" ng-class="{active: isActive(item.link)}">
<a ng-href="{{item.link}}">{{item.title}}</a>
</li>
</ul>
<!-- Navbar items visible when collapsed -->
<ul class="nav navbar-nav navbar-right visible-xs">
<li ng-hide="isLoggedIn()" ng-class="{active: isActive('/login')}">Login</li>
<li ng-show="isLoggedIn()"><p class="navbar-text">Hello {{ getCurrentUser().name }}</p></li>
<li ng-show="isLoggedIn()" ng-class="{active: isActive('/logout')}">Logout
</li>
</ul>
</div>
<!-- Navbar items visible when not collapsed -->
<ul class="nav navbar-nav navbar-right hidden-xs">
<li ng-hide="isLoggedIn()" ng-class="{active: isActive('/login')}">Login</li>
<li ng-show="isLoggedIn()"><p class="navbar-text">Hello {{ getCurrentUser().name }}</p></li>
<li ng-show="isLoggedIn()" ng-class="{active: isActive('/logout')}">Logout</li>
</ul>
</div>
</nav>
Let's simplifying an example that describes what you need to do
<div class="navbar">
<div class="navbar-inner">
<div class="ps-content">
<button type="button" class="btn btn-navbar visible-phone" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<div class="brand">Navigation</div>
<ul class="nav hidden-desktop hidden-tablet">
<li>Separated link</li>
</ul>
<!-- PS RHS menu items -->
<div class="visible-tablet pull-right">
<ul class="nav">
<li class="active">Active link</li><li class="divider-vertical"></li>
<li>Second link</li><li class="divider-vertical"></li>
<li>Third link</li>
</ul>
</div>
<div class="nav-collapse pull-right">
<ul class="nav pull-right ">
<li class="active text-right">Actives link</li><li class="divider-vertical"></li>
<li class="text-right">Second link</li><li class="divider-vertical"></li>
<li class="text-right">Third link</li>
</ul>
</div>
</div>
</div>
</div>
Check this bootply

Moving fixed bootstrap navbar inside container

I am trying to create a page using jquery.pagepiling.js and bootstrap. Basically It's a one page scrolling site and each page fits into the browser window. I couldn't figure out how to move the default fixed navbar inside the container.
http://imgur.com/ssIMPcU
<nav id="menu" class="navbar-fixed-top container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="col-sm-4">
<div class="collapse navbar-collapse" id="navbar-collapse">
<div class="navbar-inner">
<ul class="nav">
<li data-menuanchor="page1" class="active">section1
</li>
<li data-menuanchor="page2">section2
</li>
</ul>
</div>
</div>
</div>
</nav>
[EDIT PER COMMENTS - 2014-11-210]
Putting the menu into the container, inside a row, is very easy...pretty much straight from the bootstrap site...as I said, just remove the navbar-fixed-top to make it position itself relative within its containing tag.
<!doctype html>
<html>
<head>
<title>Bootstrap Menu</title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap-theme.min.css">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script>
</head>
<body>
<div class='container'>
<div class='row'>
<div class='col-xs-12' style='height:200px;'>I'm the row above</div>
</div>
<div class='row'>
<nav class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<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>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li class="active">Link <span class="sr-only">(current)</span></li>
<li>Link</li>
<li class="dropdown">
Dropdown <span class="caret"></span>
<ul class="dropdown-menu" role="menu">
<li>Action</li>
<li>Another action</li>
<li>Something else here</li>
<li class="divider"></li>
<li>Separated link</li>
<li class="divider"></li>
<li>One more separated link</li>
</ul>
</li>
</ul>
<form class="navbar-form navbar-left" role="search">
<div class="form-group">
<input type="text" class="form-control" placeholder="Search">
</div>
<button type="submit" class="btn btn-default">Submit</button>
</form>
<ul class="nav navbar-nav navbar-right">
<li>Link</li>
<li class="dropdown">
Dropdown <span class="caret"></span>
<ul class="dropdown-menu" role="menu">
<li>Action</li>
<li>Another action</li>
<li>Something else here</li>
<li class="divider"></li>
<li>Separated link</li>
</ul>
</li>
</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav>
</div>
<div class='row'>
<div class='col-xs-12' style='height:200px;'><br /><br /><br />I'm the row below</div>
</div>
</div>
</body>
</html>

How do I create a responsive navbar with a logo, searchbox and links and still be responsive?

I am trying to achieve a two row navigation using BS 3, but I am having a hard time find out how to do it. Every method I've tried has failed. I would like to keep the markup as standard as possible. Here's what I want it to look like:
http://jsfiddle.net/technotarek/ePGa9/
The example uses old BS code. I can't seem to get it to work in BS 3.0.
Here's my attempt. The logo is quite large, but I want it to scale accordingly.
<nav class="navbar navbar-default" role="navigation">
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<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="/"><img class="img-responsive" src="http://placehold.it/490x164&text=Logo" alt="My Logo"></a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse">
<form class="navbar-form pull-right">
<div class="input-group">
<input type="text" class="search-box-text form-control" />
<span class="input-group-btn">
<button type="submit" class="btn btn-default"><i class="icon-search"></i></button>
</span>
</div>
</form>
<ul class="nav navbar-nav pull-right">
<li>Register</li>
<li>Log in</li>
</ul>
</div><!-- /.navbar-collapse -->
</div>
</nav>
Your code is here BootstrapNavbarWithLogoSearchbarResponsive
html
<div class="navbar navbar-default">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-responsive-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#"> <img src="http://placehold.it/70x70">
</a>
</div>
<div class="navbar-collapse collapse navbar-responsive-collapse">
<ul class="nav navbar-nav">
<li class="active">Active</li>
<li>Link</li>
<li class="dropdown">
Dropdown <b class="caret"></b>
<ul class="dropdown-menu">
<li>Action</li>
<li>Another action</li>
<li>Something else here</li>
<li class="divider"></li>
<li class="dropdown-header">Dropdown header</li>
<li>Separated link</li>
<li>One more separated link</li>
</ul>
</li>
</ul>
<form class="navbar-form navbar-left">
<input type="text" class="form-control col-lg-8" placeholder="Search">
</form>
<ul class="nav navbar-nav navbar-right">
<li>Link</li>
<li class="dropdown">
Dropdown <b class="caret"></b>
<ul class="dropdown-menu">
<li>Action</li>
<li>Another action</li>
<li>Something else here</li>
<li class="divider"></li>
<li>Separated link</li>
</ul>
</li>
</ul>
</div>
</div>
css
.navbar-brand {
float: left;
height: 10%;
padding: 0;
}