TheCuBeMan
TheCuBeMan

Reputation: 2443

scaling down the view of the content inside an iframe

I have an iframe on a page where I display my own HTML content.

I need to scale down the display of this content, but not by CSS's zoom definition, more like zooming with the CTRL+[mouse wheel] in the browser.

For example, if you hold down the CTRL key and scroll down with your mouse wheel, even in the current page you're reading now, you'll notice that everything displays smaller but kept in proportion and scale. The same goes for scrolling up, of course.

I need to do that with JS/JQ/CSS for the content of the iframe, as mentioned.

Just to be clear - not to have the effect of being able to scale down or up, but to get the final result - displaying the page scaled down.

I should mention that when I change the "zoom" CSS definition of the elements in the content, everything does display smaller, but not kept in proportion and thus messing up the page layout and structure.

Upvotes: 0

Views: 675

Answers (1)

Upperface
Upperface

Reputation: 121

I would suggest your add the css-rule transform: scale(0.5); to your iframe or the content you want to resize. The example scales your content to 50% size.

Upvotes: 1

Related Questions