这是我的简单代码,我不知道为什么但onresize
不起作用
<head>
<style>
#blueDiv {
background-color: blue;
}
</style>
<script type="text/javascript">
function ChangeSize(){
document.getElementById("blueDiv").innerHTML = "onresize problem";
}
function myOnResize( e ) {
alert("please work");
}
</script>
</head>
<body>
<div id="blueDiv"></div>
<button onclick="ChangeSize();">Change the size of the blue element</button>
<script>
document.getElementById("blueDiv").onresize = myOnResize;
</script>
</body>
我也尝试使用div resize
来抓住我的jquery
...就像这样
<br/>
`$( document.getElementById("blueDiv") ).bind('resize', function(){ alert( "please work" ); });`
<br/>or this<br/>
`$( document.getElementById( "blueDiv" ) ).resize(function() { alert( "please work" ); });`
但它似乎不想工作
有人可以帮忙吗?
由于