JavaScript

Program to implement Full Screen Navigation as Sliding in from the left.

Program to implement Full Screen Navigation as Sliding in from the left.
<html>
<head>
<style>
body {
    font-family: "Times New Roman", Times, serif;
}
.nav {
    height: 100%;
    width: 0;
    position: fixed;
    z-index: 1;
    background-color:black;
    overflow-x: hidden;
    transition: 0.5s;
}

.nav-content {
    position: relative;
    top: 25%;
    width: 100%;
    text-align: center;
    margin-top: 30px;
}

.nav span , .nav p{
    padding: 8px;
    text-decoration: none;
    font-size: 36px;
    color: #818181;
    display: block;
    transition: 0.3s;
}
.nav p:hover, .nav p:focus {
    color: #f1f1f1;
}
.nav span:hover, .nav span:focus {
    color: #f1f1f1;
}

.nav .btn {
    position: absolute;
    top: 20px;
    right: 45px;
    font-size: 60px;
}

</style>
</head>
<body>

<div id="Nav" class="nav">
<span class="btn" onclick="closeNav()">&times;</span>
<div class="nav-content">
<p> Hello TutorialsLink! </p>
</div>
</div>

<h2>Fullscreen Overlay Navigation</h2>
<p>Click on the button below to open the fullscreen overlay navigation</p>
<button style="font-size:15px;cursor:pointer" onclick="openNav()"> Click Me!</button>

<script>
function openNav() {
    document.getElementById("Nav").style.width = "100%";
}

function closeNav() {
    document.getElementById("Nav").style.width = "0%";
}
</script>
     
</body>
</html>
Nitin Pandit

With over 10 years of vast development experience with different technologies, Nitin Pandit is Microsoft certified Most Valued Professional (Microsoft MVP) with a rich skillset that includes developing and managing IT/Web-based applications in different technologies, such as – C#.NET, ADO.NET, LINQ to SQL, WCF, and ASP.NET 2.0/3.x/4.0, WCF, WPF, MVC 5.0 (Razor), and Silverlight, along with client-side programming techniques, like jQuery and AngularJS. Nitin possesses a Master’s degree in Computer Science and has been actively contributing to the development community for its betterment. He has written more than 100 blogs/articles and 3 eBooks on different technologies to help improve the knowledge of young technology professionals. He has trained more than one lakh students and professionals, as a speaker in workshops and AppFests, conducted in more than 25 universities in North India.