npr / responsiveiframe

Responsive IFrames
http://npr.github.com/responsiveiframe/
MIT License
321 stars 194 forks source link

persistent 10-ish px scroll bar area on resize #34

Open joshp23 opened 7 years ago

joshp23 commented 7 years ago

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');
antonandreyev commented 5 years ago

I confirm the issue. Another option to fix it (on the client side!) is to change 120 line from var h = document.body.offsetHeight; to var h = document.body.offsetHeight + 20;