I am running a third party script and it calculates an element's width upon loading. It works great but I have a responsive website and when I re-size the browser the element is no longer displayed correctly.
Here is the code that is used to calculate the width:
var w = ticker.width();
if (label.length) w -= label.outerWidth() + parseFloat(label.css("margin-right"));
if (controls.length) w -= controls.outerWidth() + parseFloat(controls.css("margin-left"));
news.css("width", w);
How do I modify this part of the script to re-calculate the width when the browser is resized?