Skip to content

Instantly share code, notes, and snippets.

@grapho
Last active July 7, 2016 16:58
Show Gist options
  • Save grapho/b7b172557cf642ad0a67f9b2f2ff72ee to your computer and use it in GitHub Desktop.
Save grapho/b7b172557cf642ad0a67f9b2f2ff72ee to your computer and use it in GitHub Desktop.
tabbable menu
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
body {
margin: 12px 16px;
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-size: 12pt;
}
.container {
background: rgba(0, 0, 0, .6);
color: #fff;
}
.menu {
max-height: 0;
overflow: hidden;
}
.container:hover > .menu,
.container:focus > .menu {
max-height: 150px;
}
.item:hover,
.item:focus {
background: rgba(0, 0, 0, .2);
}
<h1>Welcome to {{appName}}</h1>
<br>
<br>
<div class="container" tabindex="-1">
<p>Items</p>
<div class="menu">
<div class="item" tabindex="0">
Item 1
</div>
<div class="item" tabindex="0">
Item 2
</div>
<div class="item" tabindex="0">
Item 3
</div>
<div class="item" tabindex="0">
Item 4
</div>
</div>
</div>
{
"version": "0.10.1",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
"ember": "2.6.0",
"ember-data": "2.6.1",
"ember-template-compiler": "2.6.0"
},
"addons": {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment