Click to See Complete Forum and Search --> : strech or not duplicating a picture in the background
pelegk1
05-29-2003, 06:10 AM
i have an image in the size of 120*80
and the code for it :
<body background="Images\icons\background.gif" bgproperties=fixed >
how can i make :
1) to make the image not to duplicate itself!
so it will be only 120*80
2)to make stretch on all of the screen
(withough duplicate itself!
thnaks
Peleg
gil davis
05-29-2003, 06:19 AM
To "stretch" the bg image, see http://www.webreference.com/dhtml/diner/bgresize/
To make the image just not repeat, place this in the head section:
<style type="text/css">
BODY {background-repeat: no-repeat}
</style>or change the body tag to this:
<body style='background-image: url("Images\icons\background.gif"); background-repeat: no-repeat'>
pelegk1
05-29-2003, 06:59 AM
first thanks this all the answers i wanted!
second :
how do i get the image original wodth and height with javascript code?
thnaks in advance
Peleg
gil davis
05-29-2003, 04:05 PM
You could use a preload script to get those values, but you would also need to incorporate an onload event handler to make sure that the values are available.var bgImg = new Image();
bgImg.src = "Images\icons\background.gif";
bgImg.onload = function () {
// whatever you intend to do with the width and height
}