Search code examples
javascriptcsswebwebkitzooming

Can I see the entire document when zooming the document using webkit-transform?


I zoom the document using webkit-transform as below.

document.body.style.WebkitTransform = 'scale(2)';

Then, below code for resizing scrollbar to see entire document doesn't work.

document.body.style.overflow = 'scroll';

I tried below codes instead, however they don't work.

document.body.style.overflow = 'auto';

or

document.body.style.webkitOverflow = 'scroll';

Was the document cut off after zooming?(If so, I can't see the entire document.)
Or do you have any ideas to see entire document after zooming like resizing scrollbars?


Solution

  • Thanks to Fahad, I could solve my question.
    Fahad adviced me to apply extra paddings and margins. I tried some paddings and margins. And I found that applying extra margins is solution. Applying extra margins, I can scale up the whole body regardless of the transformOrigin. Thank you very much!