jQuery things by John Resig

http://ejohn.org/apps/workshop/adv-talk

Advertisements

Dynamically getting browser window size with jQuery

After a long search I found that jQuery code.

<html>

<head>

<script type=”text/javascript” src=”jquery.js”></script>
<script type=”text/javascript”>

$(window).resize(function () {
$(‘#msg’).text(‘Browser (Width : ‘ + $(window).width() + ‘ , Height :’ + $(window).height() + ‘ )’);
});

</script>
</head>
<body>
<div id=”msg” style=”border:solid 1px red;”></div>

</body>

</html>

It’s working.