"Full Screen Search Popup On Focus"
Bootstrap 4.0.0 Snippet by xrozix

<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <!------ Include the above in your HEAD tag ----------> <!-- Navigation --> <nav class="navbar navbar-expand-md navbar-dark bg-dark"> <div class="container"> <a class="navbar-brand" href="#" class="text-white">Bootstrap</a> <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsExampleDefault" aria-controls="navbarsExampleDefault" aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-icon"></span> </button> <div class="collapse navbar-collapse" id="navbarsExampleDefault"> <ul class="navbar-nav mr-auto"> <li class="nav-item active"> <a class="nav-link" href="#">Home</a> </li> <li class="nav-item"> <a class="nav-link" href="#">About Us</a> </li> <li class="nav-item"> <a class="nav-link" href="#">Services</a> </li> <li class="nav-item"> <a class="nav-link" href="#">Products</a> </li> <li class="nav-item"> <a class="nav-link" href="#">Contact</a> </li> </ul> </div> <div class="w-25"> <input type="text" class="form-control rounded-0 bg-dark ser-input" id="ser-input" placeholder="Search..."> <div class="search-full-view"> <div class="input-group"> <input type="text" class="form-control" placeholder="Search..."> <span class="input-group-addon"><i class="fa fa-search" aria-hidden="true"></i></span> </div> <button class="btn btn-close" id="search-close"> <img src="http://d9hhrg4mnvzow.cloudfront.net/www2.iweb.com/windows-server-2016/ed5b870c-clear-close-cancel-white.png"></button> </div> </div> </div> </nav> <!-- Navigation --> <h1 class="m-3">Full Screen Search Popup On Focus</h1>
@import url('https://maxcdn.bootstrapcdn.com/font-awesome/4.6.0/css/font-awesome.min.css'); .ser-input{ border-color: transparent; border-bottom-color: #fff; color: #fff; } .ser-input:focus { border-color: transparent; color: #fff; border-bottom: 1px solid #fff; } .search-full-view { position: fixed; width: 100%; height: 100%; left: 0; top: 0; background: rgb(0, 0, 0); opacity: 0; z-index: -1; transition: .5s all; transform: scale(0); } .search-full-view.search-normal-screen { opacity: 1; z-index: 1; transform: scale(1); } .search-full-view .input-group { width: 80%; margin: 0 auto; top: 40%; height: 100px; } .search-full-view .input-group .form-control { background: transparent; border-bottom: 2px solid #fff; font-size: 6em; padding: 10px; vertical-align: unset; color: #cdcdcd; } .search-full-view .input-group .form-control:focus{ border-color: #fff; border:0 !important; border-bottom: 2px solid #fff !important; } .search-full-view .input-group .input-group-addon { background: transparent; font-size: 4em; color: #fff; border: 0; cursor: pointer; } .search-full-view .btn-close { background: transparent; border: 0; position: absolute; top: 10px; right: 10px; cursor: pointer; } .search-full-view .btn-close img { width: 60px; }
$(document).ready(function() { $("#ser-input").focus(function() { $('.search-full-view').addClass("search-normal-screen"); }); $("#search-close").click(function() { $('.search-full-view').removeClass("search-normal-screen"); }); });

Related: See More


Questions / Comments: