1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
<script language="javascript">
function DocDims(){
var db = document.body;
var dde = document.documentElement;
var docHeight = Math.max(db.scrollHeight, dde.scrollHeight, db.offsetHeight, dde.offsetHeight, db.clientHeight, dde.clientHeight)
var docWidth = Math.max(db.scrollWidth, dde.scrollWidth, db.offsetWidth, dde.offsetWidth, db.clientWidth, dde.clientWidth)
return {'dheight': docHeight,'dwidth': docWidth}
}
$(function(){
$("div[id^='ABC']").css({ 'height': DocDims().dheight,
'width': DocDims().dwidth
})
});
</script>
<style type="text/css">
html, body {height:100%}
</style>
</head>
<body>
<div style="background-color:red" id="ABC2" class="dyndim">
</div>
<div style="background-color:green" id="ABC1" class="dyndim">
</div>
</body>
</html> |
Partager