Edge and scrollbars on scaled content

Giganews Newsgroups
Subject: Edge and scrollbars on scaled content
Posted by:  Andrew Poulos (ap_pr…@hotmail.com)
Date: Fri, 9 Aug 2019

I have a fixed sized iframe within a responsively sized DIV which has
overflow set to auto.

If scrollbars do appear on the DIV there's a button which, when
selected, will scale the iframe to fit within the DIV's current size.
For this the button calls some JavaScript to set some CSS:

  // 'factor' is calculated earlier
  ifrm.style.webkitTransform = 'scale(' + factor + ')';
  ifrm.style.transform = 'scale(' + factor + ')';

On Chrome, Firefox and Edge the iframe is scaled neatly into the DIV.

The only issue is that Edge will continue to display the scrollbars as
they appeared before the scaling. If I scroll there's no content to
display and DevTools shows that the size of the iframe is within the
confines of the DIV.

How can I get Edge to *not* show scrollbars when content is dynamically
sized to fit?

Andrew Poulos

Replies