Tazz
04-26-2004, 10:36 PM
Hello, I am trying to have my background image selected based on viewers resolution.
This is the code I found via the net. Is there something that needs modified so it works with other browsers? I have tested in IE6 (works) and NS7(doesn't work).
<Script Language="JavaScript">
var scrh = screen.Height
var scrw = screen.Width
if ( scrh == "768" && scrw == "1024" )
{
document.write("<body bgcolor='000000' background=themes/cmg/images/background.jpg>")
}
else
{
document.write("<body bgcolor='000000' background=themes/cmg/images/background5.jpg>")
}
</Script>
This is the code I found via the net. Is there something that needs modified so it works with other browsers? I have tested in IE6 (works) and NS7(doesn't work).
<Script Language="JavaScript">
var scrh = screen.Height
var scrw = screen.Width
if ( scrh == "768" && scrw == "1024" )
{
document.write("<body bgcolor='000000' background=themes/cmg/images/background.jpg>")
}
else
{
document.write("<body bgcolor='000000' background=themes/cmg/images/background5.jpg>")
}
</Script>