Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

no tile effect for background image

Status
Not open for further replies.
Jun 3, 2002
11
US
Is there any way to have dreamweaver not tile the background image when the browser window is expanded to larger than the actual image? I think this is possible. It would be great if the image could resize to the dimensions of the browser window. Any help would be appreciated. Thanks. PS check out the site to see what I'm talking about.
 
Some time ago, I located this javascript on the net.
I'm not sure where it originated from, and it may even be outdated...all I know is, it works ok for me! ;-)

<!-- SCRIPT FOR RESIZING BACKGROUND IMAGE -->
<SCRIPT LANGUAGE=&quot;JavaScript1.2&quot;>
NS4 = (document.layers);
IE4 = (document.all);

scaleWidth = true;
scaleHeight = true;
<!-- Your image URL in the line below -->
imSRC = &quot;images/weather.jpg&quot;;

if (NS4) window.onload = setResize;

function setResize(){
setTimeout(&quot;window.onresize=reDo;&quot;,500);
}

function reDo(){
window.location.reload()
}

if (IE4) window.onresize = reDoIE;

function reDoIE(){
imBG.width = document.body.clientWidth;
imBG.height = document.body.clientHeight;
}

function makeIm() {

winWid = (NS4) ? innerWidth : document.body.clientWidth;
winHgt = (NS4) ? innerHeight : document.body.clientHeight;

imStr = &quot;<DIV ID=elBGim&quot;
+ &quot; STYLE='position:absolute;left:0;top:0;z-index:-1'>&quot;
+ &quot;<IMG NAME='imBG' BORDER=0 SRC=&quot; + imSRC;
if (scaleWidth) imStr += &quot; WIDTH=&quot; + winWid;
if (scaleHeight) imStr += &quot; HEIGHT=&quot; + winHgt;
imStr += &quot;></DIV>&quot;;

document.write(imStr);

}
//-->
</SCRIPT>
</HEAD>

<BODY MARGINHEIGHT=0 MARGINWIDTH=0>
<SCRIPT LANGUAGE=&quot;JavaScript1.2&quot;>
<!--
makeIm();
//-->
</SCRIPT>
<!-- END BACKGROUND RESIZE SCRIPT -->
 
you site looks cool but the background image file size is WAY to large....you need to trim it down a bit actally a big bit I waited cuz I wanted to see but most people wont they will think the site is down or having trouble.
[afro] whos that behind you?
 
thanks deecee,

I will trim down the bg file size. What would you say is the best size for quick load time but decent quality? Thanks
 
You need to keep the entire page weight to 40k or under for a general internet audience. If the site is targeted towards, say, business users that you know have high speed connectivity then you can increase the file size appropriately. A 12 second download is about the max people will tolerate - less for high speed users (they aren't used to waiting).

Here in Wyoming I have to keep a 28.8 audience in mind. In your market you might be able to design for 56k users or better. Or you might not have a geographic market.

Nice graphics.

Peace
BT
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top