I have a DOM element that consists of a chart.
<div id="plot1" class='plot-chart'></div>
This specific DIV can be nested within various other DIVs.
<div id="one" style="width:100%;height:100%;zoom:0.9;">
<div id="two">
<div id="three">
<div id="plot1" class='plot-chart'></div>
</div>
</div>
</div>
</div>
I am looking for a solution to detect any changes in size or zoom of all parent elements surrounding the plot DIV, so I can adjust its size accordingly.
window.onresize
While this method works fine for detecting changes in the browser window size overall, there might be situations where the size of DIV two or DIV three is altered without affecting the entire window. Since the position of the Chart DIV can vary, calling an external function when a resize occurs is not a viable option.
In essence, is there a way to identify modifications in any of the parent DIVs of my object internally triggering the execution of a function?