Full Screen Navbar using CSS and JQuery
Posted By : Gaurav Arora | 30-Sep-2016
In this blog, we will create a full screen navbar using css and jquery. There are many plugins for the same thing, but we can do it simply with the help of few css and jquery functions.
We will start by creating our HTML structure like this.
After that we will include some css to make our navbar looks better. As I am using the basic one's you can make it look more attractive by applying more styles
#close{position: absolute; top: 10px; right: 10px; color: #fff; } .nav{width: 100%; height: 100%; position: fixed; left: 0; top: 0; background: rgba(0, 0, 0, .5); left: -100%; backface-visibility: hidden; } ul{float: left; position: relative; top: 50%; left: 50%; transform: translate(-50%, -50%); padding: 0; text-align: center; } li{width: 100%; float: left; list-style: none; }
After that we will include some jquery functions to show hide our menu
$(function(){ $("#open").click(function(){ $(".nav").animate({left: "0px"}); }); $("#close").click(function(){ $(".nav").animate({left: "-100%"}); }); });
You can modify this according to your need.
In this way we can create a full screen navbar using css and jquery
THANKS
Cookies are important to the proper functioning of a site. To improve your experience, we use cookies to remember log-in details and provide secure log-in, collect statistics to optimize site functionality, and deliver content tailored to your interests. Click Agree and Proceed to accept cookies and go directly to the site or click on View Cookie Settings to see detailed descriptions of the types of cookies and choose whether to accept certain cookies while on the site.
About Author
Gaurav Arora
Gaurav is an experienced UI developer with experience and capabilities to build compelling UI's for Web and Mobile Applications.