Let's get the fiddles out of the way first (built on the Foundation responsive framework):
Fiddle 1: one nav element, but becomes unfixed when side nav slides out
Fiddle 2: working but with multiple nav elments
Okay so, I have been racking my brain trying to develop and elegant solution for the following:
1) Make a responsive, fixed navigation that switches from stretching across the top to sliding out of the side on smaller screen sizes (ala the Facebook app)
2) I'd like to use the same DOM element for the navigation, rather than have two separate but identical elements
I was able to accomplish this using CSS translations, except for the fact that translations remove the fixed property of the nav (see fiddle 1).
The Fiddle 1 solution uses CSS translations like so:
-webkit-transform: translate3d(250px, 0, 0);
-moz-transform: translate3d(250px, 0, 0);
-o-transform: translate3d(250px, 0, 0);
transform: translate3d(250px, 0, 0);
While Fiddle 2 acts on the left and right margins of the content:
margin-right: -250px;
margin-left: 250px;
I'd like to somehow find a way to use just one DOM element for both elegance and so nav-related plugins will still work (like scrollspy)