This is a migrated thread and some comments may be shown as answers.

Reverse scroll direction of ListBox?

1 Answer 161 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
Alex
Top achievements
Rank 1
Alex asked on 20 Jan 2017, 10:55 PM

I am working on a real-time chat area in my site where I have a listbox that has chat messages show up as they come in. My issue is that I want all new message to show up at the bottom of the page, and to have the scroll position kept at the bottom of the page. 

I found javascript to set the scroll-position to the bottom of the listbox on pageload, but some of the messages may contain large images that, on slow 3G/4G phones, take a bit to load in. When they finish loading in, they increase the length of the listbox's content, this making the scrollbar not be pinned to the bottom of the list.

I tried to alleviate this issue by using jQuery to scroll to the bottom of the listbox after all images are loaded, but for many users this results in the listbox's scroll position jerking around.

Is there an easier way to just *reverse* the scrolling direction of the listbox, or some alternative I am missing?

1 Answer, 1 is accepted

Sort by
0
Veselin Tsvetanov
Telerik team
answered on 25 Jan 2017, 03:23 PM
Hello Alex,

I would suggest you to check if the implementation suggested in the following StackOverflow thread fits into your scenario. Keep in mind, that the RadListBox control would not allow you to reverse its scrolling direction.

Regards,
Veselin Tsvetanov
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
ListBox
Asked by
Alex
Top achievements
Rank 1
Answers by
Veselin Tsvetanov
Telerik team
Share this question
or