Full Screen Navbar using CSS and JQuery

Posted By : Gaurav Arora | 30-Sep-2016

Full Screen Navbar Using CSS And jQuery

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

About Author

Author Image
Gaurav Arora

Gaurav is an experienced UI developer with experience and capabilities to build compelling UI's for Web and Mobile Applications.

Request for Proposal

Name is required

Comment is required

Sending message..