Hello,
I’m new here, and I have got a problem with some Javascript-code.
My English isn’t very well… but I try to make good senteces, sorry for that.
First the problem: I would like to load a .CSS file depending of the resolution of a computer.
This is what I have done:
<head>
<SCRIPT LANGUAGE=”JavaScript”><!–
function loadFile(){
if(screen.width == 1024 && screen.height == 768){
<link href=”menu.css” rel=”stylesheet” type=”text/css”>
}
else if(screen.width == 1280 && screen.height == 800){
<link href=”menu2.css” rel=”stylesheet” type=”text/css”>
}
}
//–></script>
</head>
<body onLoad=”loadFile()”>
Can somebody tell me why this isn’t working?
I hope I will have got a quick reply.
Regards,
Daboytommy87