Skip to content

Instantly share code, notes, and snippets.

@LevelbossMike
Last active January 17, 2017 14:33
Show Gist options
  • Select an option

  • Save LevelbossMike/6ca82bc3a11fd81b9a91b35a4f85de87 to your computer and use it in GitHub Desktop.

Select an option

Save LevelbossMike/6ca82bc3a11fd81b9a91b35a4f85de87 to your computer and use it in GitHub Desktop.
New Twiddle
import Ember from 'ember';
import InViewportMixin from 'ember-in-viewport';
export default Ember.Component.extend(InViewPortMixin, {
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
body {
display: flex;
height: 100%;
min-height: 100%;
}
.header {
flex: 0 0 auto;
background: grey;
}
.header-content {
height: 10vh;
}
.content {
flex: 1 1 auto;
height: 80vh;
width: 100vw;
overflow-y: scroll;
background: red;
}
.footer {
flex: 0 0 auto;
height: 10vh;
background: grey;
}
.scrollable {
height: 200vh;
position: relative;
}
.should-stick {
position: absolute;
top: 300px;
height: 100px;
width: 100%;
background: green;
}
<div class='header'>
<div class="header-content">Content</div>
</div>
<div class='content'>
{{outlet}}
</div>
<div class="footer">
footer
</div>
<div class="sticky">
</div>
<div class="scrollable">
<div class="should-stick">
</div>
</div>
{
"version": "0.10.7",
"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.10.0",
"ember-data": "2.10.0",
"ember-template-compiler": "2.10.0",
"ember-testing": "2.10.0"
},
"addons": {
"ember-in-viewport": "2.1.1",
"ember-elsewhere": "0.4.1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment