Menu slide in/out isn't working! Need help!
Menu slide in/out isn't working! Need help!
Hey. I followed everything on doing a menu slide in and slide out from the left side. But it is not working if i click on the menu icon. Could you please help me?
index.html
<!doctype html>
<html>
<head>
<title>Testpage</title>
<link href="style.css" rel="stylesheet" type"text/css" />
</head>
<body>
<header>
<div id="sidebar-btn">
<span></span>
<span></span>
<span></span>
</div>
<script src="
https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script tpye="text/javascript">
$(document).ready(function(){
$('#sidebar-btn').click(function(){
$('#sidebar').addClass('visible');
});
</script>
</header>
<div id="sidebar">
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Portfolio</a></li>
<li><a href="#">Blog</a></li>
</ul>
</div>
</body>
</html>
style.css
body {
background: #f3f3f3;
margin: 0;
padding: 0px;
font-family: "helvetica neue";
}
header {
background: white;
color: white;
padding: 20px;
box-shadow: 0px 0.5px 8px #C6C6C6;
position:static;
}
ul {
margin: 0px;
padding: 0px;
}
ul li{
list-style: none;
}
ul li a{
color: #f3f3f3;
text-decoration: none;
display: block;
width: 180px;
padding: 10px;
}
div {
}
#sidebar {
background: #333;
width: 200px;
height: 100%;
display: block;
position: absolute;
left: -200px;
top: 0px;
transition: left 0.3s linear;
}
#sidebar.visible {
left: 0px;
transition: left 0.3s linear;
}
#sidebar-btn {
display: inline-block;
vertical-align: middle;
width: 20px;
height: 15px;
cursor: pointer;
margin: 15px;
}
#sidebar-btn span {
height: 2px;
background: #333;
margin-bottom: 4px;
display: block;
}
footer {
color: black;
margin: 1%;
float: right;
clear: both;
}
Topic Participants
xxthelastwarriorxx
jakecigar