Did you forget to place quotes around the text or did you do that by purpose??
Try this:
Code:
function resize(){
if (screen.width >=640) {
img.banner.src = "banner640.jpg";
document.write("<link rel='stylesheet' type='text/css' href='style640.css' />");
} else if (screen.width >=800) {
img.banner.src = "banner800.jpg";
document.write("<link rel='stylesheet' type='text/css' href='style800.css' />");
} else if (screen.width <= 1040) {
img.banner.src = "banner.jpg";
document.write("<link rel='stylesheet' type='text/css' href='style.css' />");
}
And by the way please don't forget to place [\CODE][/CODE] tags around your codes.
Bookmarks