Jquery中的resize方法

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd
">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script src="http://code.jquery.com/jquery-latest.js
"></script>
<script language="javascript">
$(document).ready(function(){
 $(window).resize(function() {
    $('#log').append('<div>Handler for .resize() called. Window widthis ' + $(window).width() + '</div>');
 });
});
</script>
</head>
<body>
<div id="log">请缩小或放大窗口。</div>
</body>
</html> 

你可能感兴趣的:(JavaScript,html,jquery)