I was using window.innerHeight and window.innerWidth to calculate the correct size for a transparent "blackout" <div>. It blacked out the screen so and an options box was displayed on top of it. A few days later, on a seperate file and seperate project, I used the same functions to calculate the document size, but got values of 0 being returned every time. I then had to use document.body.clientHeight and document.body.clientWidth to calculate the document size instead. The annoying thing is, neither one worked in the other project.
I'm not expecting answers to the above problems because they've been sorted out and are no longer problems. What I'm confused about is why a function/object will work one day, then the next, in a seperate project, they don't work. My first example of getting client document sizes is perfect. I am currently working on a 2nd project where I would like to get the client document size and am having to use the seperate objects to return height, whereas in my other project I am using the aforementioned ones.
Can anyone enlighten me as to what could be going on? Doctypes? any declarations I've not considered? Anything?