I am building a chat widget, which is minimized (collapsed and fixed to bottom of page) by default and then maximized when clicked.
It has a fixed height, and overflow-y: scroll. I want the scrollbar to start at the bottom and scroll upwards, but this is prettry problematic.
If I never collapse the widget, which I do with widget.toggle('blind') (JQuery), I can simply scroll with javascript on page load: using .scrollTop(), however, I want the widget to initially be collapsed. Using .scrollTop() on the collapsed widget has no effect! Furthermore, whenever I collapse/expand the widget, it scrolls all the way to the top.
Is there a library or do you have some hints to solve this?
widget.toggle('blind', function(){/* scroll here */}). Thanks for the hint