0

How could I have an iframe that shows the target page and all it's elements at 50% scale?

My first thought was trying to write a css scale property to the frame, but I'm not sure if you can write css to the contents of the frame.

Thanks!

fancy
  • 48,619
  • 62
  • 153
  • 231

2 Answers2

0

Since the page is in the same domain, you might be able to place this code:

<script type="text/javascript">
if (location.href != top.location.href) {

   // the page is loaded inside an iframe so
   // Make everything 50% scale (I'm not sure what the code for that is in pure js)
   // With jQuery:

   $("*").css("zoom","50%");

} 
</script>

In the head of the page you are loading in the iframe.

If you're not using JQuery, this page

http://pietschsoft.com/post/2006/06/01/Javascript-Loop-through-all-elements-in-a-form.aspx

has a good example of how to loop through all the elements in a form without a library like JQuery.

Mikey G
  • 3,473
  • 1
  • 22
  • 27
0

Easier then I thought...

<iframe id="frame"></iframe>

$('#frame').css
    '-webkit-transform': 'scale(.5)'
    '-moz-transform': 'scale(.5)'
    '-o-transform': 'scale(.5)'
fancy
  • 48,619
  • 62
  • 153
  • 231