这里有个网页: [url=http://www.dnssjy.com/openwindows/openwindows.html]http://www.dnssjy.com/openwindows/openwindows.html[/url]
是从Javaeye下载的Demo:
在IE7下,点击窗口,是这个效果[img]http://www.dnssjy.com/openwindows/IE7.jpg[/img]
但是在IE9和其它浏览器下是这个效果:[img]http://www.dnssjy.com/openwindows/IE9.jpg[/img]
请问,如果我想让非IE7的浏览器也能看上去是IE7的效果:1、弹出的DIV可设定TOP值,2、整个背景变灰,要怎么改写代码?
让ie9模拟ie7,在head里加上以下这句
参考
http://stackoverflow.com/questions/7397568/how-do-i-make-ie9-emulate-ie7
var heightB=document.documentElement.clientHeight;
//弹出div id为popDiv
var heightD= document.getElementById("popDiv").clientHeight;
document.getElementById("popDiv").style.top= (heightB-heightD)/2;
背景变灰直接改body的background
你的代码主要是出现了在IE对于JS的兼容问题
width: expression(body.scrollWidth);
height: expression(body.scrollHeight);
你可以把些代码写在js 中这样该错误也好改。这种动态的CSS技术最好不要常用。