![]() |
|
|
+ Search |
![]()
|
Apr 7th, 2008 23:01
ha mo, Colin Fraser, kris Nelson,
Use these:
in Netscape:
window.innerWidth - Specifies the horizontal dimension, in pixels, of
the window's content area.
in IE
screen.width - Specifies the horizontal resolution of the screen, in
pixels.
so the script in the head would be :
<script type="text/javascript">
//determin browser name
bname=navigator.appName
if (bname.indexOf("Netscape")!=-1) {
scrwidth= window.innerWidth;
}
if (bname.indexOf("Microsoft")!=-1) {
scrwidth=screen.width
}
}
switch (scrwidth) {
case 600 :
document.write("<body background='600.jpg'>")
break;
case 800 :
document.write("<body background='800.jpg'>")
break;
default:
document.write("<body background='1000.jpg'>")
}
This code replaces the normal prewritten and fixed body tag.
This has some risk attached to it, mainly because there are so many
screens out there with so many different resolutions. You may be asking
for more trouble than you expect.
http://www.businessian.com
http://www.computerstan.com
http://www.financestan.com
http://www.healthstan.com
http://www.internetstan.com
http://www.moneyenews.com
http://www.technologystan.com
http://www.zobab.com
http://www.healthinhealth.com