1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
---|
2 | <html xmlns="http://www.w3.org/1999/xhtml"> |
---|
3 | <head> |
---|
4 | <title>boxModel test</title> |
---|
5 | <style type="text/css"> |
---|
6 | html, body { |
---|
7 | height: 100%; |
---|
8 | margin: 0; |
---|
9 | padding: 0; |
---|
10 | } |
---|
11 | #container { |
---|
12 | min-height: 100%; |
---|
13 | background: #ccc; |
---|
14 | position: relative; |
---|
15 | } |
---|
16 | #footer { |
---|
17 | position: absolute; |
---|
18 | bottom: 0; |
---|
19 | } |
---|
20 | |
---|
21 | </style> |
---|
22 | <!--[if IE]> |
---|
23 | <style type="text/css"> |
---|
24 | #container { |
---|
25 | height: 100%; |
---|
26 | } |
---|
27 | </style> |
---|
28 | <![endif]--> |
---|
29 | <script type="text/javascript"> |
---|
30 | var jQuery = { support: {} }; |
---|
31 | |
---|
32 | function boxModel_current(){ |
---|
33 | var div = document.createElement("div"); |
---|
34 | div.style.width = "1px"; |
---|
35 | div.style.paddingLeft = "1px"; |
---|
36 | |
---|
37 | document.body.appendChild( div ); |
---|
38 | jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2; |
---|
39 | document.body.removeChild( div ); |
---|
40 | }; |
---|
41 | |
---|
42 | function boxModel_patch(){ |
---|
43 | var div = document.createElement("div"); |
---|
44 | div.style.width = div.style.paddingLeft = "1px"; |
---|
45 | |
---|
46 | document.body.appendChild( div ); |
---|
47 | jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2; |
---|
48 | document.body.removeChild( div ).style.display = 'none'; |
---|
49 | }; |
---|
50 | |
---|
51 | </script> |
---|
52 | </head> |
---|
53 | <body> |
---|
54 | <div id="container"> |
---|
55 | <div> |
---|
56 | <span>#container</span><br /> |
---|
57 | <input type="button" value="Check as of rev 6169" onclick="boxModel_current()" /><br /> |
---|
58 | <input type="button" value="Patch (display:none)" onclick="boxModel_patch()" /><br /> |
---|
59 | </div> |
---|
60 | <div id="footer"> |
---|
61 | #footer |
---|
62 | </div> |
---|
63 | </div> |
---|
64 | </body> |
---|
65 | </html> |
---|