Click to See Complete Forum and Search --> : can i make an image 100% of back ground in css


SeGamysa
06-03-2003, 01:35 PM
I have this back ground image that is fixed but it only spans about 86% of a certain papge is there a way i can make to auto adjust to browser resolution and still stay fixed? but the user would be able to scroll?

Mr J
06-03-2003, 02:47 PM
Try this



<SCRIPT language=JavaScript1.2>
<!--
function init(){
img_width = (document.layers) ? window.innerWidth : document.body.clientWidth;
img_height = (document.layers) ? window.innerHeight : document.body.clientHeight;
bg_img.width = img_width
bg_img.height = img_height
}
onresize=init

// add onload="init()" to the opening BODY tag

//-->
</SCRIPT>

<img name="bg_img" src="pic1.jpg" border=0 style="position:absolute;left:0;top:0;z-index:-1">



To see an example see

www.huntingground.freeserve.co.uk/scripts/bgstretch.htm

SeGamysa
06-03-2003, 02:58 PM
thanx for the help

khaki
06-18-2003, 05:39 PM
hi SeGamysa...

you haven't been around in a while...

but I can't let a special day for you pass without acknowledging it...

So...

HAPPY BIRTHDAY SeGamysa!!!

(you are... and always will be... older than me :) )

Hope you have fun today!!!

;) k