|
Hey all..
I am trying to change a link's color, based on the user's screen resolution.
The javascript I have is:
<script type="text/javascript">
var RecommendedSize;
if(window.screen.width<690){
RecommendedSize = "640";
}else if(window.screen.width<850){
RecommendedSize = "800";
}else if(window.screen.width<1079){
RecommendedSize = "1024";
}else if(window.screen.width<1330){
RecommendedSize = "1280";
}else{
RecommendedSize = "1600";
}
var RecommendedSize = x;
function wallpaperRes(x)
{
document.getElementById(x).style.color = "#F90";
}
</script>
In the HTML, I've given each link an ID, such as "640", "800", "1024", etc, corresponding with the values of the ReccomendedSize variable above.
I think I have the right idea here, but how do I make this actually work? If only I knew what I was doing, eh.. ?
Thanks!
Vanessa
|
|
|
|
|
|
|
|