I'll give that a try. In the meanwhile I tried to learn a little bit about using Javascript and so far this is working for me:
Javascript code
Code:
if ((screen.width == 1280) && (screen.height == 800)) {
document.getElementById('Body').className="bg1"
}
else if ((screen.width == 800) && (screen.height == 600)) {
document.getElementById('Body').className="bg3"
}
else if ((screen.width == 1024) && (screen.height == 768)) {
document.getElementById('Body').className="bg4"
}
else if ((screen.width == 1920) && (screen.height == 1200)) {
document.getElementById('Body').className="bg5"
}
else {
document.getElementById('Body').className="bg1";
}
And CSS-code
Code:
.bg1 {
background-image: url(images/bg768.jpg);
background-repeat: no-repeat;
background-color: #000000;
background-position: center top;
}
.bg2 {
background-image: url(images/bg600.jpg);
background-repeat: no-repeat;
background-color: #000000;
background-position: center top;
}
.bg3 {
background-image: url(images/bg800x600.jpg);
background-repeat: no-repeat;
background-color: #000000;
background-position: center top;
}
.bg4 {
background-image: url(images/bg1024x768.jpg);
background-repeat: no-repeat;
background-color: #000000;
background-position: center top;
}
.bg5 {
background-image: url(images/bg1920x949.jpg);
background-repeat: no-repeat;
background-color: #000000;
background-position: center top;
}
I link to the code and Javascript in my <head> tags and this is working just fine.
One downside, I'll probably need to make a lot of images in order to have it fit on most screens. I think I'll stick to 10 resolutions and if one visitor who hasn't got that resolution, it will just get a default Background which would basicly fit on every screen.
With a few exceptions: Not going to make my website fit in 640px and lower..
Hope this is maybe usefull for anyone.