Menu
Hi,
Using HTML, is it possible to automaticly resize a picture to fit on a page?
The script needs to be compatiable with frames. It must be HTML so all browsers can see the picture.
Thanks,
Neil
[CODE]
<HTML>
<HEAD>
<TITLE>Document Title</TITLE>
<script>
function init(){
width=document.body.clientWidth
height=document.body.clientHeight
if('width/height=>2.499'){document.getElementById("mypic").width=height*2.25; document.getElementById("mypic").height=height*0.9;};
if('width/height=<2.5'){document.getElementById("mypic").width=width*0.9; document.getElementById("mypic").height=width*0.36;};
}
</script>
</HEAD>
<BODY onload="init()" onresize="init()">
<img id="mypic" src="elvisdayout.jpg" width='400' height='160'>
</BODY>
</HTML>
[/CODE]
[i]Originally posted by neil9999 [/i]The whole point of only useing one is so that the image will be in proportion. The frame will not be a perfect square so useing two will throw the image out of proportion, this is especially true if the frame's size is not constant. It is better that the image be a little smaller then out of proportion correct?
[B]
PeOfEo, the size of the frame can vary, so only using height='100%' wouldn't work.
[/B][/QUOTE]
0.1.9 — BETA 6.16