<style>
iframe{position:absolute;width:200;height:200;fason:expression(this.style.left=(screen.width-this.offsetWidth)/2)}
</style>
iframe{position:absolute;width:200;height:200;fason:expression(this.style.left=(screen.width-this.offsetWidth)/2)}
</style>
解决方案 »
- Jquery - FlexiGrid 的相关问题
- 这是什么用法?
- 请问javascript中有没有类似PHP的bin2hex函数,并能支持UTF-8类型的中文成为Hex?
- js代码模块改由数据库中动态加载,妥否?
- 帮看看DIV弹出窗口的问题
- 怎样获得iframe中链接中的html内容
- 请问当我想关闭ie窗口时,点击关闭时要它弹出一个对话框,确定后才关闭,当我刷新时候不弹出窗口.如何实现
- 怎样让在输入框的文字居中?<input>
- 在网页内怎么嵌入一个横向滚动条?
- <tr onclick="javascript:var guigexinghao='"';>如何把"字符串赋给guigexinghao?
- 同一页面两个不同功能的脚本为什么没有办法同时将功能实现?!?
- IE显示页面的时候,忽略了一些字符.
iframe{position:absolute;width:200;height:200;fason1:expression(this.style.left=(document.body.clientWidth-this.offsetWidth)/2);fason2:expression(this.style.top=(document.body.clientHeight-this.offsetHeight)/2)}
</style>
<body onscroll="a1.style.top=document.body.scrollTop">
<div id=a1 style="position:absolute"><iframe src="1.htm"></iframe></div>
<p>123</p><p>123</p><p>123</p><p>123</p><p>123</p><p>123</p><p>123</p><p>123</p><p>123</p><p>123</p><p>123</p><p>123</p><p>123</p><p>123</p><p>123</p><p>123</p><p>123</p><p>123</p><p>123</p><p>123</p><p>123</p><p>123</p><p>123</p><p>123</p><p>123</p><p>123</p><p>123</p><p>123</p><p>123</p><p>123</p><p>123</p><p>123</p><p>123</p><p>123</p><p>123</p><p>123</p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p>
</body>
<body onscroll="a1.style.top=document.body.scrollTop">
<div id=a1 style="position:absolute"><iframe src="1.htm"></iframe></div>
<p>123</p><p>123</p><p>123</p><p>123</p><p>123</p><p>123</p><p>123</p><p>123</p><p>123</p><p>123</p><p>123</p><p>123</p><p>123</p><p>123</p><p>123</p><p>123</p><p>123</p><p>123</p><p>123</p><p>123</p><p>123</p><p>123</p><p>123</p><p>123</p><p>123</p><p>123</p><p>123</p><p>123</p><p>123</p><p>123</p><p>123</p><p>123</p><p>123</p><p>123</p><p>123</p><p>123</p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p>
</body>把位置修改成fason(阿信) 所说的就可以了
fason2:expression(this.style.top=(document.body.clientHeight-this.offsetHeight)/2);写成下面的样子更简洁left:expression((document.body.clientWidth-this.offsetWidth)/2);
top:expression((document.body.clientHeight-this.offsetHeight)/2);