Thursday, September 10, 2009

Adjusting wallpaper for screen resolution

Do you have non-standard or strange monitor resolutions? Wallpaper having trouble adapting. Try this little javascript. Works well as the html wallpaper when used with group policy. Change resolution? No problem, this well adapt easily.

<!--
<script language="JavaScript">
var netpath = "file://///server\\sysvol\\server/Policies/{19FB4C1D-637F-479E-98BF-FE8CEEF217C6}/User/Applications/wallpaper/";

if ((screen.width==1024) &amp;&amp; (screen.height==768))
{
window.location=netpath + "SSE_1024x768.html";
}
else if ((screen.width==1152) &amp;&amp; (screen.height==864))
{
window.location=netpath + "SSE_1152x864.html";
}
else if ((screen.width==1280) &amp;&amp; (screen.height==1024))
{
window.location=netpath + "SSE_1280x1024.html";
}
else if ((screen.width==1680) &amp;&amp; (screen.height==1050))
{
window.location=netpath + "SSE_1680x1050.html";
}
else
{
window.location=netpath + "error.html";
}
</script>
-->