questo è uno script preso da un sito
Codice PHP:
<script language="javascript">
<!--
var s_width ='';
var s_height ='';
s_width=screen.width
s_height=screen.height
if (s_width == "640"){
location.href="640_x_480.htm";
}
if (s_width == "800"){
location.href="800_x_600.htm";
}
if (s_width == "1024"){
location.href="1024_x_768.htm";
}
if (s_width == "1152"){
location.href="1152_x_864.htm";
}
if (s_width == "1280"){
location.href="1280_x_1024.htm";
}
//-->
</script>
che va fuso con questoa istruzione
Codice PHP:
document.body.background = "img01.gif";
risultato:
Codice PHP:
<script language="javascript">
<!--
var s_width ='';
var s_height ='';
s_width=screen.width
s_height=screen.height
if (s_width == "640" && s_height ="480"){
document.body.background = "img01.gif";
}
if (s_width == "800" && s_height ="600"){
document.body.background = "img02.gif";
}
if (s_width == "1024" && s_height ="768"){
document.body.background = "img03.gif";
}
if (s_width == "1152" && s_height ="864"){
document.body.background = "img04.gif";
}
if (s_width == "1280" && s_height ="1024"){
document.body.background = "img05.gif";
}
//-->
</script>
non è precisissimo poiche ci sono le varie risoluzioni per i video 16:9 ma puoi tranquillamente aggiungerle tu studiacchiandoti questo script