fit.js icon indicating copy to clipboard operation
fit.js copied to clipboard

improvement: watch the container size

Open og2t opened this issue 11 years ago • 1 comments

It would be nice to be able to actually watch the container, and trigger fitting when it changes, not just when the window size changes :)

Real life case: a video element being part of the WebRTC communication client with collapsible chat drawer. When the chat collapses, the video resizes and refits but no window resize event in happening. No debounce needed as the resize has to as smooth as poss.

Thanks!

og2t avatar Feb 17 '14 15:02 og2t

Although, on the second thought maybe it's not a good idea to have it included with fit.js – since the use case scenario will always be different. I've ended up adding RAF when CSS3 transition starts and killing it when it ends.

og2t avatar Feb 18 '14 08:02 og2t