H
hippo
Hi,
What i would like to have is the following:
User comes on page and script detects what resolution user have.
Due to screen resolution the background image of the page is changed.
I try the follwing but i an errors all the time (error: object
required). This is strange, without the if statement and implement the
code in a function the code works.
Got anyone a clue?
<html>
<head>
<title>mysample</title>
<SCRIPT language="JavaScript">
<!--
if (screen.width == 1024) {
document.body.style.backgroundImage='url(myimage.jpg)';
}
//-->
</SCRIPT>
</head>
<body>
blablabla
</body>
</html>
What i would like to have is the following:
User comes on page and script detects what resolution user have.
Due to screen resolution the background image of the page is changed.
I try the follwing but i an errors all the time (error: object
required). This is strange, without the if statement and implement the
code in a function the code works.
Got anyone a clue?
<html>
<head>
<title>mysample</title>
<SCRIPT language="JavaScript">
<!--
if (screen.width == 1024) {
document.body.style.backgroundImage='url(myimage.jpg)';
}
//-->
</SCRIPT>
</head>
<body>
blablabla
</body>
</html>