在 iframe 中循环缩放网页?
我正在尝试合并之前在这里提出的两个问题的代码。 如何循环浏览页面? 我想使用此代码创建一个信息亭并循环浏览网页。我还想使用 如何缩放 iframe 的内容?< /a> 用于缩放 iframe 的内容。理想情况下,我想按不同的系数缩放每个页面,但如果这是不可能的,那么我将使用静态值。顺便说一句,是否可以将页面自动缩放到特定的屏幕分辨率,还是我必须不断尝试各种因素,直到找到理想的分辨率?谢谢
<style>
#wrap { width: 1390px; height: 690px; padding: 0; overflow: hidden; }
#frame { width: 1390px; height: 690px; border: 0px solid black; }
#frame { zoom: 2; -moz-transform: scale(2); -moz-transform-origin: 0 0; }
</style>
<script type="text/javascript">
var frames = Array('http://www.google.com, 5,
'http://www.yahoo.com', 5,
'http://www.ebay.com', 5);
var i = 0, len = frames.length;
function ChangeSrc()
{
if (i >= len) { i = 0; }
document.getElementById('frame').src = frames[i++];
setTimeout('ChangeSrc()', (frames[i++]*1000));
}
window.onload = ChangeSrc;
</script>
</head>
<body>
<div id="wrap">
<iframe src="" id="frame" scrolling="no" frameborder="0"></iframe>
</div>
</body>
</html>
I'm trying to combine code from two questions previously asked here before. How can I cycle through pages? I want to use this code to create a kiosk and cycle through webpages. I also want to use How can I scale the content of an iframe? this to scale the content of the iframe. Ideally I would like to scale each page by a different factor, but if this is not possible then I will use a static value. On a side note, is it possible to scale the page automatically to a certain screen resolution or will I have to keep trying factors until I find an ideal one? Thanks
<style>
#wrap { width: 1390px; height: 690px; padding: 0; overflow: hidden; }
#frame { width: 1390px; height: 690px; border: 0px solid black; }
#frame { zoom: 2; -moz-transform: scale(2); -moz-transform-origin: 0 0; }
</style>
<script type="text/javascript">
var frames = Array('http://www.google.com, 5,
'http://www.yahoo.com', 5,
'http://www.ebay.com', 5);
var i = 0, len = frames.length;
function ChangeSrc()
{
if (i >= len) { i = 0; }
document.getElementById('frame').src = frames[i++];
setTimeout('ChangeSrc()', (frames[i++]*1000));
}
window.onload = ChangeSrc;
</script>
</head>
<body>
<div id="wrap">
<iframe src="" id="frame" scrolling="no" frameborder="0"></iframe>
</div>
</body>
</html>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我建议您使用这种方法: http://forrst.com/posts/css3_dynamic_website_thumbnails_with_an_iframe-CGk
您可以通过更改 iframe 的 src 属性来循环浏览页面:
这个问题也非常有用: jQuery 网页预览
I'd suggest you use this approach: http://forrst.com/posts/css3_dynamic_website_thumbnails_with_an_iframe-CGk
You can cycle through pages by changing the src attribute of the iframe:
This question is also pretty useful: jQuery Webpage Preview