strech or not duplicating a picture in the background

admin

Administrator
Staff member
i have an image in the size of 120*80<br />
and the code for it :<br />
<body background="Images\icons\background.gif" bgproperties=fixed ><br />
<br />
how can i make :<br />
1) to make the image not to duplicate itself!<br />
so it will be only 120*80<br />
2)to make stretch on all of the screen<br />
(withough duplicate itself!<br />
thnaks<br />
Peleg<!--content-->To "stretch" the bg image, see <!-- m --><a class="postlink" href="http://www.webreference.com/dhtml/diner/bgresize/">http://www.webreference.com/dhtml/diner/bgresize/</a><!-- m --><br />
<br />
To make the image just not repeat, place this in the head section:<br />
<style type="text/css"><br />
BODY {background-repeat: no-repeat}<br />
</style>or change the body tag to this:<br />
<body style='background-image: url("Images\icons\background.gif"); background-repeat: no-repeat'><!--content-->first thanks this all the answers i wanted!<br />
second :<br />
how do i get the image original wodth and height with javascript code?<br />
thnaks in advance<br />
Peleg<!--content-->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();<br />
bgImg.src = <!-- m --><a class="postlink" href="http://www.webdeveloper.com/forum/archive/index.php/">http://www.webdeveloper.com/forum/archive/index.php/</a><!-- m -->"Images\icons\background.gif";<br />
bgImg.onload = function () {<br />
// whatever you intend to do with the width and height<br />
}<!--content-->
 
Back
Top