I'm have a .js file with the following code:
Code: Select all
var doc = document;
omg_scroll = doc.body.scrollHeight;
omg_client = doc.body.clientHeight;
calculation = Math.round(omg_client / omg_scroll);
document.write(calculation);The problem is that omg_scroll & omg_client are always equal to 0. What I'm doing wrong?
To make it more clear, how can I get the scrollHeight and the clientHeight with javascript?
Thanks in advanced!