私は現在、次の条件を使用していますが、ブラウザー間で機能していないか、まったく機能していません。
if (typeof (window.innerHeight) == 'number') {
//Non-IE:
//Perform operation using window.innerWidth/Height
} else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
//IE 6+ in 'standards compliant mode'
//Perform operation using document.documentElement.clientWidth/Height
} else if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
//IE 4 compatible
//Perform operation using document.body.clientWidth/Height
}
条件が1つか2つ欠けていると思います。おそらく、考慮していない別の一般的な表現があります。
これを完了するには何を追加する必要がありますか?