Is there an event I can listen for in JavaScript that tells me the computed style for a particular DOM element has changed?
If not, what is the least blocking way to get the computed style of a DOM element using JavaScript?
Is there an event I can listen for in JavaScript that tells me the computed style for a particular DOM element has changed?
If not, what is the least blocking way to get the computed style of a DOM element using JavaScript?
There is no event listener for on change of computed style of a DOM element.
You can write one yourself if you are fancy, watching the value of getComputedStyle through setInterval, but it could be expensive and unwieldy depending on implementation.
If you are only worried about style changes on resize you should use the window.onresize (below), or possibly the JQuery resize event handler.
There is a very good read here about in depth cross browser solution for referencing CSS3 properties, however the following is a simple solution for various popular browsers via this answer.