diff options
Diffstat (limited to 'files/zh-cn/web/api/globaleventhandlers/onresize/index.html')
| -rw-r--r-- | files/zh-cn/web/api/globaleventhandlers/onresize/index.html | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/files/zh-cn/web/api/globaleventhandlers/onresize/index.html b/files/zh-cn/web/api/globaleventhandlers/onresize/index.html new file mode 100644 index 0000000000..4afad82e58 --- /dev/null +++ b/files/zh-cn/web/api/globaleventhandlers/onresize/index.html @@ -0,0 +1,71 @@ +--- +title: window.onresize +slug: Web/API/GlobalEventHandlers/onresize +translation_of: Web/API/GlobalEventHandlers/onresize +--- +<p>{{ ApiRef() }}</p> + +<h3 id="Summary" name="Summary">概述</h3> + +<p><code>onresize</code>属性可以用来获取或设置当前窗口的resize事件的事件处理函数</p> + +<h3 id="Syntax" name="Syntax">语法</h3> + +<pre class="eval">window.onresize = <em>funcRef</em>; +</pre> + +<h3 id="Parameters" name="Parameters">参数</h3> + +<ul> + <li><code>funcRef</code> 是一个函数引用</li> +</ul> + +<h3 id="Example" name="Example">例子</h3> + +<pre>window.onresize = doFunc; +</pre> + +<pre><html> +<head> + +<title>onresize测试</title> + +<script type="text/javascript"> + +window.onresize = resize; + +function resize() +{ + alert("检测到resize事件!"); +} +</script> +</head> + +<body> +<p>改变浏览器窗口的大小来触发resize事件.</p> +</body> +</html> +</pre> + +<h3 id="Notes" name="Notes">备注</h3> + +<p>在窗口大小改变之后,就会触发resize事件.</p> + +<h3 id="Specification" name="Specification">规范</h3> + +<table class="spectable standard-table"> + <tbody> + <tr> + <th scope="col">Specification</th> + <th scope="col">Status</th> + <th scope="col">Comment</th> + </tr> + <tr> + <td>{{SpecName('HTML WHATWG','webappapis.html#handler-onresize','onresize')}}</td> + <td>{{Spec2('HTML WHATWG')}}</td> + <td> </td> + </tr> + </tbody> +</table> + +<p>{{ languages( {"en": "en/DOM/window.onresize" } ) }}</p> |
