malihu / malihu-custom-scrollbar-plugin

Highly customizable custom scrollbar jQuery plugin, featuring vertical/horizontal scrollbars, scrolling momentum, mouse-wheel, keyboard and touch support etc.
http://manos.malihu.gr/jquery-custom-content-scroller
MIT License
4.11k stars 1.51k forks source link

Default position at bottom without scrollToBottom jitter on load #578

Open pdesai-tff opened 6 years ago

pdesai-tff commented 6 years ago

Note: The solution posted on https://github.com/malihu/malihu-custom-scrollbar-plugin/issues/409 generate unpleasent jitter on load.

I am using this scrollbar for a messaging app, where, when a new contact is selected, all the messages shows in the detail panel, and that panel, upon initial load, should always be scrolled to bottom to show the latest message.

How can I implement the scrollbar so that the default position is always at the bottom (without using scrollToBottom on load). The content is dynamic, so cannot set the setTop to a contact value. Need a feature like setBottom:0 by default. Any other way to achieve it?

I am currently doing it using scrollToBottom on load, and it shows a jitter due to scroll, which is not a great experience.