From 2fbbee5daa28d07f86f76d4a37b5a9e7b5a8c03d Mon Sep 17 00:00:00 2001 From: TheMrNomis Date: Fri, 17 Apr 2015 11:22:39 +0200 Subject: [PATCH] Hamburger menu --- hamburger.js | 9 +++++++++ images/menu.png | Bin 0 -> 262 bytes index.css | 9 ++++++--- index.html | 10 ++++++---- 4 files changed, 21 insertions(+), 7 deletions(-) create mode 100644 hamburger.js create mode 100644 images/menu.png diff --git a/hamburger.js b/hamburger.js new file mode 100644 index 0000000..68ce875 --- /dev/null +++ b/hamburger.js @@ -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); diff --git a/images/menu.png b/images/menu.png new file mode 100644 index 0000000000000000000000000000000000000000..8d5228721bb825f6c352bda727e34c17d0ed9ff7 GIT binary patch literal 262 zcmeAS@N?(olHy`uVBq!ia0vp^2_VeD0wg^q?%xcg6p}rHd>I(3)EF2VS{N990fib~ zFff!FFfhDIU|_JC!N4G1FlSew4N!t9$=lt9;eUJonf*W>XMsm#F#`j)FbFd;%$g$s z6s+@faSW-r_4ejQP6h=YmIE%E{-3gH>{W2txh2e9?xAV=9$RIgGE~5~Y@7OBxt<`P z{R|9wch>!5hsu{E&5ZyFmLy3-MJ{xfCJ8bzFkI-&g^Iwb2h|6d+Bw+w?^e&&0SS7# L`njxgN@xNAl5ajC literal 0 HcmV?d00001 diff --git a/index.css b/index.css index f4b57fe..e0e1b50 100644 --- a/index.css +++ b/index.css @@ -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%; diff --git a/index.html b/index.html index 781ed0e..d2ed9e3 100644 --- a/index.html +++ b/index.html @@ -9,11 +9,12 @@
+ menu logo ESIR
- - + +