87,901
社区成员
发帖
与我相关
我的任务
分享
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>onresize test</title>
<script type="text/javascript">
window.onresize = resize;
function resize() {
alert("resize event detected!");
}
</script>
</head>
<body>
<p>Resize the browser window to fire the resize event.</p>
</body>
</html>
Sys.Application.add_load(function(sender, args) {
$addHandler(window, 'resize', window_resize);
});
var resizeTimeoutId;
function window_resize(e) {
window.clearTimeout(resizeTimeoutId);
resizeTimeoutId = window.setTimeout('doResizeCode();', 10);
}
<input type="button" value="open" id="btn1" />
<script type="text/javascript" >
$("#btn1").click(function(event) {
window.open("1.htm","","width=100,height=100,resizable=yes");
});
</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>1</title>
</head>
<body>
<div id="div1">i not set </div>
</body><script type="text/javascript" src="js/jquery-1.6.4.min.js" ></script>
<script type="text/javascript" >
var i = 0;
var s = "";
window.resizeBy(100, 100);
$(document).ready(function() {
$(window).resize(function() {
i++;
s += "i=" + i + ",width=" + $(window).width() + "; ";
document.getElementById("div1").innerHTML = s;
});
});
</script>
</html>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="gb2312" />
<title></title>
<style>
</style>
</head>
<body>
<div id="a"></div>
<script>
function $(o){return document.getElementById(o);}
window.onresize = function(){
setTimeout(function(){
$('a').innerHTML = Math.floor(Math.random() * 100);
}, 1000)
}
</script>
</body>
</html>