I have a specific requirement where I want to display 3 panels (Chats, Groups, Channels) in the left panel. The challenge is to adjust their heights dynamically based on both the screen resolutions and the content within each panel.
To achieve this, I will be making API calls to retrieve items for each panel and then using angular bindings to render them.
You can check out the prepared JSFiddle here for better clarity. In the JSFiddle, additional media queries have been implemented to adjust the max-heights based on different resolutions.
My main requirements are as follows:
- If all three panels have no items at all, they should collapse - functionality that is already in place.
- If any of the 3 panels contain more items than can fit, a scroll should appear - which is also working correctly.
- If only one panel has items, it should automatically expand to fit the size.
- If there are only a few items in two panels but many in the third, it should display like shown in the image here.
I initially thought about using jQuery after the API calls to manipulate the items count and handle the resizing accordingly. However, this approach seems challenging due to the need to consider both resolutions and item counts across all panels. Are there any CSS solutions available for achieving this complex layout? Alternatively, could you recommend any articles or resources I can refer to for guidance? Is jQuery the only viable option for solving this issue?