ブラウザの最大化と復元の最大化の幅と高さ
1169 ワード
ブラウザの最大化と復元の最大化取得幅と高さ:
<script type="text/javascript">
<!--
var winWidth = 0;
var winHeight = 0;
function findDimensions() // :
{
//
if (window.innerWidth)
winWidth = window.innerWidth;
else if ((document.body) && (document.body.clientWidth))
winWidth = document.body.clientWidth;
//
if (window.innerHeight)
winHeight = window.innerHeight;
else if ((document.body) && (document.body.clientHeight))
winHeight = document.body.clientHeight;
// Document body ,
if (document.documentElement && document.documentElement.clientHeight && document.documentElement.clientWidth)
{
winHeight = document.documentElement.clientHeight;
winWidth = document.documentElement.clientWidth;
}
//
document.form1.availHeight.value= winHeight;
document.form1.availWidth.value= winWidth;
}
findDimensions();
// ,
window.onresize=findDimensions;
//-->
</script>