1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>Le titre</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-15" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta http-equiv="Content-Language" content="fr" />
<style type="text/css">
.det {
color : red;
}
</style>
</head>
<body>
<div id="wallpaper_dl">
<a href="#">800x600</a><br />
<a href="#">1024x768</a><br />
<a href="#">1152x864</a><br />
<a href="#">1280x720</a><br />
</div>
<script>
//alert(screen.width + ' ' + screen.height);
if(screen.width && screen.height){
ancarr = document.getElementById("wallpaper_dl").getElementsByTagName("a");
//alert(ancarr.length);
for(x=0; x<ancarr.length; x++)
{if(ancarr[x].innerHTML.replace(/\s/g,"")== screen.width +"x"+ screen.height) { ancarr[x].className = "det"; ancarr[x].innerHTML = ancarr[x].innerHTML + "<br/>Detected Resolution"; } }
}
</script>
</body>
</html> |
Partager