English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

thanks in advance, any questions just ask

2007-07-31 08:29:36 · 5 answers · asked by abebibobub2003 3 in Computers & Internet Programming & Design

It's a bit of a pain to have to get pictures the same size as the frame and it's even worse to resize them myself

2007-07-31 08:33:45 · update #1

sorry dino D it's not quite that simple, i want images that are opening in an Iframe to be resized to fit said frame

2007-07-31 08:39:18 · update #2

5 answers

change the following to suit your needs:
document.body is probably what you will change first to check the size of your iframe. you may already know these values, so you could even hard code them.
good luck.

function sizeImage( newImage )
{
var ImgMain = mainImage; // this is an empty image in the frame
var nClientX = document.body.clientWidth - 50;// leave room on sides
var nClientY = document.body.clientHeight - 50;// leave room on top and bottom
var nWidth = newImage.width;
var nHeight = newImage.height;

// figure out how to reduce image if necessary
if (nWidth > nClientX || nHeight > nClientY)
{
var nReduce = nClientX / nWidth;
if (nReduce * nHeight > nClientY)
nReduce = nClientY / nHeight;
nWidth *= nReduce;
nHeight *= nReduce;
}

ImgMain.src = newImage.src;
ImgMain.width = nWidth;
ImgMain.height = nHeight;
}

2007-07-31 09:07:56 · answer #1 · answered by Wyatt 4 · 1 0

If you know the size of your iframe, you can just set the height or width of your image in HTML:

Use only one of width or height (the biggest one).
If the iframe size can vary, get its size using java, then set the width or height of the image like:

If you use PhP, resize the image on the server before sending it. Use the image functions in PhP (there are more than 200 of them!). Check www.php.net (the official site)

2007-07-31 23:25:50 · answer #2 · answered by just "JR" 7 · 0 0

I trust their answer of Adobe Photoshop. you will constantly lose high quality making a image better, yet whilst shrinking it you mustn't have distortion (as long as you in basic terms be confident you preserve the field checked that preserves the photographs proportions whilst resizing!)

2016-10-08 22:09:42 · answer #3 · answered by ? 4 · 0 0

depending on the images - if you meen a button size then add a size in your menu image link:
example:

Button

makes a button 100 pixels wide by 30 high

2007-07-31 08:38:02 · answer #4 · answered by Anonymous · 0 0

Is this what your referring too. I did a table and then put images inside of it that would fit. But it does require re-sizing the objects yourself to get them to fit.














2007-07-31 09:03:13 · answer #5 · answered by Anonymous · 0 0

fedest.com, questions and answers