显示分辨率,显示色彩数,显示当前IE窗口所占屏幕比重
作者:cmscn 日期:2007-06-16
<!--52600/-->
<script LANGUAGE="JavaScript">
colors = window.screen.colorDepth;
document.write("显示分辨率:"+screen.width + '*' + screen.height+" "+colors+"bit"+"<br>")
document.write("显示色彩数:"+Math.pow(2, colors)+"<br>")
</script>
<!--当前IE窗口所占屏幕比重-->
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function getwindowsize() {
if (navigator.userAgent.indexOf("MSIE") > 0) {
var sSize = (document.body.clientWidth * document.body.clientHeight);
return sSize;
} else {
var sSize = (window.outerWidth * window.outerHeight);
return sSize;
}
return;
}
// End -->
</script>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var percent = Math.round((getwindowsize()/(screen.width * screen.height)*100) * Math.pow(10, 0));
document.write("当前IE窗口所占屏幕比重:" + percent + "%");
// End -->
</script>
<!--当前IE窗口所占屏幕比重-->
评论: 1 | 引用: 0 | 查看次数: 746
发表评论