Skip to content

Instantly share code, notes, and snippets.

@pwfisher
Created March 16, 2015 23:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pwfisher/29c2bac95482792a5b59 to your computer and use it in GitHub Desktop.
Save pwfisher/29c2bac95482792a5b59 to your computer and use it in GitHub Desktop.
Ember.js "scroll-to-me" component (scrolls window to itself on didInsertElement)
import Ember from 'ember';
export default Ember.Component.extend({
didInsertElement: function () {
Ember.$('html, body').animate({ scrollTop: this.$().offset().top }, '2000');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment