Trying to do a responsive sliding animation for a navbar/menu using logos like lines and an X logo and when i click the logo nothing happens , when I debug it this error appears index.html:27 Uncaught ReferenceError: showMenu is not defined any ideas what i can change
Menu Logos only appears when viewing the page in the device toolbar
var navLinks=document.getElementById("navLink")
function hideMenu(){
navLinks.style.right= "-200px";
}
function showMenu() {
navLinks.style.right = "0";
}
*{
margin:0;
padding:0;
font-family: 'Roboto', sans-serif;
}
.header{
min-height: 100vh;
width: 100%;
background-color: transparent);
background-image: linear-gradient(rgb(94, 94, 94),#00203FFF);
background-position: center;
background-size: cover;
position: relative;
}
nav{
display: flex;
padding: 2% 6%;
justify-content: space-between;
align-items: center;
}
nav img{
width: 300px;
}
.nav-links{
flex: 1;
text-align: right;
}
.nav-links ul li{
list-style: none;
display: inline-block;
padding: 8px 12px;
position: relative;
}
.nav-links ul li a{
color: white;
text-decoration: none;
font-size: 25px;
}
.nav-links ul li::after{
content: '';
width: 0%;
height: 2px;
background: #00203FFF;
display: block;
margin: auto;
transition: 0.5s;
}
.nav-links ul li:hover::after{
width: 100%;
}
.text-box{
width: 90%;
color: white;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
text-align: center;
background-color:transparent;
}
.text-box h1{
font-size: 62px
}
.text-box p{
margin: 10px 0 40px;
font-size: 14px;
color: white;
}
.btn{
display: inline-block;
text-decoration: none;
color: white;
border: 1px solid #fff;
padding: 12px 34px;
font-size: 13px;
background: transparent;
position: relative;
cursor: pointer;
}
.btn:hover{
border: 1px solid rgb(94, 94, 94);
background: rgb(94, 94, 94);
transition: 1s;
}
nav .fas{
display:none;
}
@media(max-width: 700px){
.text-box h1{
font-size: 20px;
}
.nav-links ul li{
display: block;
}
.nav-links{
position: absolute;
background: #2A2B2DFF;
height: 100vh;
width: 200px;
top: 0;
right: -200%;
text-align: left;
z-index: 2;
transition: 1s;
}
nav .fas{
display: block;
color:black;
margin: 15px;
font-size: 25px;
cursor: pointer;
}
.nav-links ul{
padding: 27px;
}
}
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="with=device-width, initial-scale=1.0">
<title>St.Louis School Inc.</title>
<link rel="stylesheet" href="style.css">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Roboto&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.13.0/css/all.css">
<script type="text/javascript" href="menu.js"></script>
</head>
<body>
<section class="header">
<nav>
<a href="index.html"><img src="images/logo.png"> </a>
<div class="nav-links" id="navLink">
<i class="fas fa-times" onclick="hideMenu(hide)"> </i>
<ul>
<li><a href="">HOME</a></li>
<li><a href="">ABOUT US</a></li>
<li><a href="">VISION & MISSION</a></li>
<li><a href="">HISTORY</a></li>
<li><a href="">Facilities</a></li>
<li><a href="">CONTACT US</a></li>
</ul>
</div>
<i class="fas fa-bars" onclick="showMenu(show)"></i>> </i>
</nav>
<div class="text-box">
<h1>Saint Louis University Inc.</h1>
<p>etcetcetcetc</p>
<a href="" class="btn">Click here to explore</a>
</div>
</section>
</body>
</html>