F
foldface
Hi
I am trying to scale an image to be the size of the browser.
The actual scaling is easy, what I cann't do is set the size of the
div to the correct value, i.e. either most of the div is chopped off
or the scrollbars are activated as the div is too big.
The html code using the google image is shown below, any ideas?
I'm also not sure what the best newsgroup is for this?
Ta
F
<body>
<form name="frm">
<div id="TheBackgroundId" name="TheBackgroundName" style="
filter: progidXImageTransform.Microsoft.Matrix(M11=1,M22=1,M21=0,M12=0);
background-image: url(http://www.google.co.uk/intl/en_uk/images/logo.gif);
position: absolute; top: 0px; left: 0px; width: 276; height: 110;
z-index: -9999;
border:groove
"></div>
<script>
<!-- fnResize function -->
//oObj input requires an matrix filter applied.
//flMultiplier input defines the amount by which the oObj is resized.
function fnResize(oObj,widthMult, heightMult)
{
oObj.filters.item(0).M11 = widthMult;
oObj.filters.item(0).M22 = heightMult;
}
fnResize(TheBackgroundId, document.body.clientWidth/276,
document.body.clientHeight/110.0)
// heres the problem
TheBackgroundId.style.poswidth = document.body.clientWidth;
TheBackgroundId.style.posheight = document.body.clientHeight;
</script>
</form>
</body>
I am trying to scale an image to be the size of the browser.
The actual scaling is easy, what I cann't do is set the size of the
div to the correct value, i.e. either most of the div is chopped off
or the scrollbars are activated as the div is too big.
The html code using the google image is shown below, any ideas?
I'm also not sure what the best newsgroup is for this?
Ta
F
<body>
<form name="frm">
<div id="TheBackgroundId" name="TheBackgroundName" style="
filter: progidXImageTransform.Microsoft.Matrix(M11=1,M22=1,M21=0,M12=0);
background-image: url(http://www.google.co.uk/intl/en_uk/images/logo.gif);
position: absolute; top: 0px; left: 0px; width: 276; height: 110;
z-index: -9999;
border:groove
"></div>
<script>
<!-- fnResize function -->
//oObj input requires an matrix filter applied.
//flMultiplier input defines the amount by which the oObj is resized.
function fnResize(oObj,widthMult, heightMult)
{
oObj.filters.item(0).M11 = widthMult;
oObj.filters.item(0).M22 = heightMult;
}
fnResize(TheBackgroundId, document.body.clientWidth/276,
document.body.clientHeight/110.0)
// heres the problem
TheBackgroundId.style.poswidth = document.body.clientWidth;
TheBackgroundId.style.posheight = document.body.clientHeight;
</script>
</form>
</body>