阅读背景:

使用ember更新属性后如何滚动到DOWN

来源:互联网 
I am using ember view, once the page loads i want to scroll down to the page.In view didInsertElement will call and make the page load to scroll down, here is my code 

 App.MessagesView = Ember.View.extend({
  didInsertElement: function() {
    this._super();
    var $target = $('.chat-area .chat-list')
    ,   height = 0;
    if ($target) {
        $target.each(function(i, items_list) {
            $(items_list).find('li').each(function() {
                console.log($(this).height());
                height = height + parseInt($(this).height());
            });
        });
        $target.animate({ scrollTop: height});
    }
}
I am using ember view, once the page loads i wa



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: