Browse Source

Hamburger menu

master
n0m1s 11 years ago
parent
commit
2fbbee5daa
4 changed files with 21 additions and 7 deletions
  1. +9
    -0
      hamburger.js
  2. BIN
      images/menu.png
  3. +6
    -3
      index.css
  4. +6
    -4
      index.html

+ 9
- 0
hamburger.js View File

@ -0,0 +1,9 @@
var button = document.getElementById("hamburgerButton");
var menu = document.getElementById("hamburgerMenu");
var open = false;
button.addEventListener('click', function(){
menu.style.left = (open)? '-382px' : '0px';
open = !open;
}, false);

BIN
images/menu.png View File

Before After
Width: 96  |  Height: 96  |  Size: 262 B

+ 6
- 3
index.css View File

@ -1,6 +1,6 @@
body
{
padding:0px;
padding:0px;
overflow:hidden;
}
@ -38,7 +38,7 @@ nav
{
position: absolute;
top:0px;
left:0px;
left:-382px;
width: 380px;
height: 100%;
padding: 0px;
@ -47,6 +47,9 @@ nav
border-right: 2px solid #2b2b2b;
z-index: 50;
margin:0;
transition-property:all;
transition-duration:0.4s;
}
nav .onglet
@ -209,7 +212,7 @@ table
tr
{
height:250px;
height:250px;
border-style:none;
margin:0;
width:100%;


+ 6
- 4
index.html View File

@ -9,11 +9,12 @@
</head>
<body>
<header id="title">
<a id="hamburgerButton" href="#"><img alt="menu" src="./images/menu.png" /></a>
<img alt="logo ESIR" src="./images/esir.png" />
<img class="rightLogo" alt="logo Kiwi" src="./images/KiWiCalendar.png" />
</header>
<nav id="hamburgerMenu">
<a id="ancherESIR" href="#ESIR" onclick="alert('Click on ESIR');">
<div class="onglet" id="onglet-esir">
@ -154,8 +155,8 @@
<div id="link">Invasion de kakapos</div></td>
</tr>
</table>
<div id="footer">
<div id="TextFooter">
<div id="exMois">
@ -167,5 +168,6 @@
</div>
<div>
</div>
<script src="hamburger.js"></script>
</body>
</html>

Loading…
Cancel
Save