Scroll to the end


#1

Hi guys,

I have a huge problem with my app in ember js.

I have a chat view in my app and the structure is a bit similar too:

<div id="chat-content">
    <div class="message">
    </div>
    <div class="message">
    </div>
    etc..
</div>

I’m making a scroller on id chat-content with:

#chat-content  {
    height: auto;
    max-height: 520px;
    overflow-x: hidden;
}

But as a chat view i need that the chat view starts at the end of scroll. How can i get this? (there exist a scroll view for ember js?)


#2

As answered in IRC, you can hook into the View’s didInsertElement and use window.scrollTo as shown in this Stack Overflow question. Here’s a demo: http://emberjs.jsbin.com/kucufijixe