Created
August 24, 2016 22:39
-
-
Save jdanyow/db47a4f26f48e17250f2812ad159ea28 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <template> | |
| <style> | |
| .scroll-container { | |
| position: absolute; | |
| left: 0; | |
| top: 0; | |
| right: 0; | |
| bottom: 0; | |
| border: 1px solid blue; | |
| overflow-y: auto; | |
| } | |
| .scroll-top-indicator { | |
| position: absolute; | |
| right: 70px; | |
| color: red; | |
| } | |
| </style> | |
| <!-- subscribe to scroll events and update the view-model's scrollTop property --> | |
| <div class="scroll-container" ref="myDiv" | |
| scroll.trigger="scrollTop = myDiv.scrollTop & throttle"> | |
| <!-- create some content to overflow the container --> | |
| <p repeat.for="i of 200">hello ${i}</p> | |
| </div> | |
| <!-- display the scrollTop --> | |
| <span class="scroll-top-indicator">scrollTop = ${scrollTop}px</span> | |
| </template> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export class App { | |
| scrollTop = 0; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!doctype html> | |
| <html> | |
| <head> | |
| <title>Aurelia</title> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| </head> | |
| <body aurelia-app> | |
| <h1>Loading...</h1> | |
| <script src="https://jdanyow.github.io/rjs-bundle/node_modules/requirejs/require.js"></script> | |
| <script src="https://jdanyow.github.io/rjs-bundle/config.js"></script> | |
| <script src="https://jdanyow.github.io/rjs-bundle/bundles/aurelia.js"></script> | |
| <script src="https://jdanyow.github.io/rjs-bundle/bundles/babel.js"></script> | |
| <script> | |
| require(['aurelia-bootstrapper']); | |
| </script> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment