【发布时间】:2019-06-05 09:34:34
【问题描述】:
我对 JS onresize 有点困惑,并针对此问题查看了 W3schools。但这给我带来了更多的问题。所以我决定在 Stack 上问它。
所以基本上:
HTML
<h1>The resize Property</h1>
<div onresize="test()">
<p>Let the user resize both the height and the width of this div element.</p>
<p>To resize: Click and drag the bottom right corner of this div element.</p>
</div>
<p><b>Note:</b> Internet Explorer does not support the resize property.</p>
CSS
div {
border: 2px solid;
padding: 20px;
width: 300px;
resize: both;
overflow: auto;
}
Javascript
function test() {
alert("Resized");
}
JSFiddle:https://jsfiddle.net/v95yLtxd/
我有点期待 JS 函数在调整大小时执行。
为什么这没有像我预期的那样工作?
【问题讨论】:
标签: javascript html css