How to make plot resize based on event in webpage containing plot div

I have a plotly.js plot inside a parent div on a webpage. If I resize the window the plot resizes to fit in it’s parent div. If I run jquery to to change the size of the parent div using css(when you click the parent it goes full screen), the plot doesn’t update until the window size is changed again. How can I make the plot size change whenever it’s parent div size changes instead of just when the window size changes? I have seen a couple examples on this forum that are close, but I can’t get them to work… Thank you so much!