Today I've noticed that our beloved Internet Explorer does not interpret document.body.scrollWidth and it doesn't support window.innerHeight. To get browser's window width and height into variables windowWidth and windowHeight you can use some code like
if (window.innerHeight != undefined){
// normal browsers
var windowHeight = window.innerHeight;
var windowWidth = document.body.scrollWidth;
} else {
// ie .. "do different .. "
var windowHeight = document.documentElement.clientHeight;
var windowWidth = document.documentElement.clientWidth;
}
Brak komentarzy:
Prześlij komentarz