This script performed well in my project with the exception of an apx 10 to 20 extra pixels that would always overflow vertically, resulting in a scroll bar with a very small scroll area, regardless of the size of the responsive frame's contents. To fix this, I had to change line 82 from
elem.css('height', height + 'px');
to this
elem.css('height', (height+20) + 'px');