2012-02-16 33 views
0

我怎么能有一个iframe,显示目标页面,并在50%的规模一切的元素呢?我怎么能有一个iframe,显示目标页面,并在50%的规模一切的元素呢?

我首先想到的是试图写一个css规模属性的框架,但我不知道,如果你可以写的CSS框架的内容。

谢谢!

+0

是否在iframe指向同一个域作为父母,或另一个域? – 2012-02-16 17:35:30

+0

同一域 – fancy 2012-02-16 17:39:47

+1

可能'* {变焦:0.5; }'虽然我不确定'zoom'在标准或合规性方面如何。 (这也可能只是一个IE的事情) – 2012-02-16 17:42:15

回答

0

更容易转念一想......

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

$('#frame').css 
    '-webkit-transform': 'scale(.5)' 
    '-moz-transform': 'scale(.5)' 
    '-o-transform': 'scale(.5)' 
+0

你忘了'-ms-transform'。现在不要诋毁微软,因为他们已经有了自己的行为。 – 2012-02-17 00:53:57

+0

.............:| – fancy 2012-02-17 00:56:47

0

因为页面是在同一个域中,你也许能够把这个代码:

<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> 

在您加载在iframe页面的头部。

如果你不使用JQuery,此页面

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

具有通过表单中所有的元素没有像jQuery库如何循环的一个很好的例子。

+0

酷,我可以看到这个工作,但我怎么注入该代码?谢谢。 – fancy 2012-02-16 23:13:25

+0

风格不应该只适用于身体? – Bergi 2012-02-16 23:49:35

+0

@Bergi可能是,我不是100%确定如何缩放属性适用 – 2012-02-17 15:53:15

相关问题