ho trovato questo codice ...
secondo voi può andare??
codice:
<script language="JavaScript" type="text/javascript">
function ClientObject() { //client sniffer - any will do
var agt = navigator.userAgent.toLowerCase();
var is_major = parseInt(navigator.appVersion);
var is_minor = parseFloat(navigator.appVersion);
this.ns = ((agt.indexOf('mozilla')!= -1) && (agt.indexOf('spoofer') == -1)
&& (agt.indexOf('compatible') == -1) && (agt.indexOf('opera') == -1)
&& (agt.indexOf('webtv') == -1) && (agt.indexOf('hotjava') == -1));
this.ns4 = (this.ns && (is_major == 4));
this.ns4up = (this.ns && (is_major >= 4));
this.ns6 = (this.ns && (is_major == 5));
this.ie = ((agt.indexOf('msie') != -1) && (agt.indexOf('opera') == -1));
this.ie4 = (this.ie && (is_major == 4) && (agt.indexOf('msie 4') != -1) );
this.ie4up = (this.ie && (is_major >= 4));
this.ie5 = (this.ie && (is_major == 4) && (agt.indexOf('msie 5.0') != -1) );
this.ie5up = (this.ie && !this.ie3 && !this.ie4);
this.ie6 = (this.ie && (is_major == 4) && (agt.indexOf('msie 6.') != -1) );
this.opera = (agt.indexOf('opera') != -1);
this.opera4 = (agt.indexOf('opera 4') != -1 || agt.indexOf('opera/4') != -1);
this.opera5 = (agt.indexOf('opera 5') != -1 || agt.indexOf('opera/5') != -1);
this.opera5up = (this.opera && !this.opera4);
this.webtv = (agt.indexOf('webtv') != -1);
}
var is = new ClientObject();
function getPageHeight() {
if (is.ie4up) {
return (document.body.scrollHeight > document.body.clientHeight) ?
document.body.scrollHeight : document.body.clientHeight;
} else if (is.ns4 || is.ns6) {
return (document.height > innerHeight) ?
document.height : innerHeight;
} else if (is.opera5up) {
return (document.body.scrollHeight > innerHeight) ?
document.body.scrollHeight : innerHeight;
}
}
</script>
Questo dovrebbe calcolare le dimensioni dell'area di visualizzazione (la pagina vera e propria)