Click to See Complete Forum and Search --> : image resize script


havoc303
09-12-2005, 03:02 AM
hi, im looking for an html or java script that automaticly resizes an image to fit across the screen. For example, your site fits well in an 800 x 600 res, but when in 1024 x 768 the site remains the same size, i want the image at the top of the site to fit across the 1024 res screen aswell. Without image distortion...

Is this possible, please help!!!!!

bathurst_guy
09-12-2005, 03:16 AM
you should only post your question once in one forum, I can take a good guess you didnt read the forum rules. Please do so, for all of our sake

havoc303
09-12-2005, 05:31 AM
Sorry, but i didnt know where to put it, cos i didnt know whether any help would be html related or java related. Sorry.

Been searching the forum since i posted it, found alot of additional useful info, but nothing quite like im looking for, even though quite a few ppl have posted the same question.

muneepenee
09-12-2005, 07:10 AM
1. yu kan yuze javaskripts tu find yuzeful width av yuzer's skreen & then chaenj the size av the pik, but if yu chaenj the width & leev hite the saem, yu stretch out pik=distort it.
2. sampel kode tu chaenj size av a pik
----------------------
//*
//************** zoompik
function zoompik(kallpik){
//****** get element by id...pikobj is [objekt]
pikobj=document.getElementById(kallpik);
//**** test pik...wide=140, hite=110
wide1=pikobj.width;
hi1 =pikobj.height;
//* stringx=" pikobj.width="+wide1+", hite="+hi1;
//* alert(stringx);
//****** inkreez pik size bi 20%
nuwide=1.2*wide1;
nuwide=Math.round(nuwide);
nuhi =1.2*hi1;
nuhi =Math.round(nuhi);
pikobj.width=nuwide;
pikobj.height=nuhi;
return
}
//******** bottom av zoompik
-----------------
3. tu get skreen size
//*********** terminal size aft subtrakt bars at top & skroll bar on rite
howwide=document.body.clientWidth;
howhi =document.body.clientHeight;
4. maby yukan tri...put pik inside a <td> & set td width tu 100%, then senter pik (horizontal)