- This topic is empty.
July 20, 2012 at 9:51 pm #38995
Have you ever used Facebook’s mobile site or app? The app sports a cool scrollable menu that slides out from the left. For mobile versions of sites, this is a fantastic way to deal with your navigation menu so you don’t take up valuable space with nav links! I’ve created a working version of that type of layout, and I decided to see if anyone wants to help collaborate on it. More information is provided in my repo – https://github.com/NicholasRBowers/CSS-Menu-Slider.
Live Demo: EDIT – next comment.
-Based off of Checkbox Hack
-Meant for mobile
-Works in major browsers (except IE, but I’m designing for mobile, so this doesn’t concern me TOO much)
-Tested on Android browser and Chrome on Android, and works moderately well in both (if you zoom, Chrome freaks out a little bit)
-Collaboration welcome!July 20, 2012 at 11:28 pm #106504
Embedded JSFiddle Result – http://jsfiddle.net/NicholasRBowers/PPZ8b/embedded/result/
JSFiddle Code – http://jsfiddle.net/NicholasRBowers/PPZ8b/July 21, 2012 at 8:29 am #106528VermaasParticipant
That looks very nifty! Nicely done, gonna fork that one :)!July 21, 2012 at 11:38 am #106535
Fantastic! Definitely feel free to brainstorm with me as to how to make it better. I added a request/suggestion tag in issues, so we can talk about improvements in functionality and cross-compatibility.July 23, 2012 at 6:42 pm #106651December 27, 2012 at 1:09 pm #119131kamesgMember
I’m going to try this out!
I’ll let you know what I come up with and show you the website once it’s live.December 28, 2012 at 1:31 pm #119218
I looked at your demo (not your code yet) but it reminded me of something I was tinkering with a while ago on codepen.
[http://codepen.io/bkbillma/pen/LKrjo](http://codepen.io/bkbillma/pen/LKrjo “Mobile Menu”)
Not sure if it is helpful or not but I hope so. We might even have a similar approachDecember 28, 2012 at 1:36 pm #119219
I actually just went and looked back at how you used the label checking the checkbox for the action and that is pretty slick. In mine i used :hover/:target/:active to try to get cross browser stuff in play.December 28, 2012 at 1:59 pm #119227
I forgot you can also see it in action in its first form [here](http://i-cart.org “I-cart”)
On desktop browsers it is certainly not ideal currently. It works better on mobile at the momentDecember 28, 2012 at 2:08 pm #119228
@ChrisP, that’s slick! I’ll implement that into my version on Github. I’m still trying to find a way to be able to make the `#page` panel unscrollable when the navigation menu is out. Thoughts?December 28, 2012 at 2:24 pm #119230
@bkbillma I thought about using :hover/:target/:active to make this work, but I forget why I ultimately decided to go a different direction. Obviously, I don’t like the idea of building a complete navigational structure off of a hack, but CSS offers very little opportunities to store state information.
Which part of the website demonstrates your version? I couldn’t find it.
@paintballer89 if you size your browser down to <400px or if you are on a small screen you will see the menu link in the top right. I even did this with :before in the 400px media querie and hook everything off of that.January 4, 2013 at 2:46 pm #119842
@ChrisP those are the same issues I’ve been struggling with for awhile. Fixed positioning and overflowing out of the window will definitely create some problems on different browsers, and will cause you to be sent right back to the top when the menu is collapsed.January 4, 2013 at 2:56 pm #119845
@bkbillma I just got a chance to look at the site under 400px on both a laptop and my phone. I see what you’ve done, but there are obvious drawbacks.
- Menu is only visible when the mouse button is held down, as soon as it’s released, the menu disappears. This makes it impossible to use the mobile version of the menu on desktop.
- Does not respect scrolling, will jump up to a little lower than the top when the menu button is clicked.
- Menu doesn’t pull out far enough, text is cut off.
- Can still scroll when menu is extended.
- Only way to collapse the menu is to click on one of the menu items.
- Does not respect the user’s scrolling. Resets to top.
A lot of these reasons are why I stayed away from the :target pseudo-class. Again, this is more of a proof of concept than something on which I would reliably base a business’s website.January 4, 2013 at 3:08 pm #119848
- The forum ‘CSS’ is closed to new topics and replies.