4 div.block { height:
100px; border:
1px solid black; margin:
10px; }
9 window
.onresize = function() {
11 document
.getElementById('count1').innerHTML
= resizecount
;
17 Test how many resize events are emitted during page load and dynamic content generation.
19 Do not resize the page. It invalidates the test.
20 <p style=
"text-indent: 10px" id=result1
>
21 Resize events (should be
0 or
1):
<span id=count1
>0</span>
23 <div id=expandingblock
>
28 var el
= document
.createElement('div');
29 el
.setAttribute('class','block');
30 document
.getElementById('expandingblock').appendChild(el
);
31 if (++blockcount
< 30)
32 setTimeout(addBlock
, 20);
38 // 0 or 1 resize events are acceptable.
40 result
= '<p style="color: green">PASS';
42 result
= '<p style="color: red">FAIL';
43 var resultElement
= document
.getElementById('result1')
44 resultElement
.innerHTML
+= result
;