PDA

View Full Version : auto resizing picture .


nits4u
07-01-2009, 05:03 PM
guys i want to set a background picture that resize itself to fit exactly within the browser with the change in resolution. mean that does not contract or stretch as we change the resolution.
as much i know it is not possible thro0' CSS.
and if i am not wrong this can be done by Java script by using a function that reads the user's current resolution and load the picture according to that.
if so than plz provide the code or is there other way out ???
thanx

jaymo
07-12-2009, 03:26 PM
Do it with CSS. Just have a background-image and set background repeat to reapeat-x. Just go for the most common resolution, which I think is 1024x768 (correct if wrong) and you should be fine.

domedia
07-12-2009, 04:09 PM
Do it with CSS. Just have a background-image and set background repeat to reapeat-x. Just go for the most common resolution, which I think is 1024x768 (correct if wrong) and you should be fine.
Uh.. how is this even addressing the question? How is this resizing the background image based on users screen resolution?

jaymo
07-12-2009, 04:16 PM
The guy said 'is there another way out', so I wrote another solution that might work for him.