script simple que je ne comprend pas
Je suis très loin d'être une grande lumière, surtout en script HTML,
ayant comme seule expérience VB5 et VB6.
Quelqu'un pourrait-il me détailler ce script?
(d'après ce que j'ai pu en comprendre et en voir, il permet
de détecter la résolution de l'écran, mais comment?)
Code:
1 2 3 4 5 6 7 8
| <script>
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> |
source: Word of Warcraft site officiel US - Wallpaper 157