<html>
<head>
<title>Get Browser Width & Height</title>
<script languuage='javascript'>
var BWidth,BHeigth;
function fn() {
if (typeof window.innerWidth != 'undefined') { // For (mozilla/netscape/opera/IE7)
BWidth = window.innerWidth;
BHeigth = window.innerHeight;
}
else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth != 'undefined' &&
document.documentElement.clientWidth != 0) { // For (IE 6 with proper doctype)
BWidth = document.documentElement.clientWidth;
BHeigth = document.documentElement.clientHeight;
}
else { //For (IE < 6)
BWidth = document.getElementsByTagName('body')[0].clientWidth,
BHeigth = document.getElementsByTagName('body')[0].clientHeight
}
document.title = 'Your Browser width is ' + BWidth + ' Height is' + BHeigth;
}
</script>
</head>
<body onresize='fn()'>
<h3>See The Page Title While Resizing the Page (Width & Height Will Be Changing</h3>
</body>
</html>
No comments:
Post a Comment