This code, allows you to get client size in all browsers..
1: function getClientSize()
2: {
3: var dom = document.createElement("div");
4: with(dom.style)
5: {
6: position="absolute";
7: right=bottom=width=height=0;
8: }
9: document.body.insertBefore(dom,document.body.firstChild);
10: var value={x:dom.offsetLeft,y:dom.offsetTop};
11: dom.style.position="";
12: document.body.removeChild(dom);
13: dom=null;
14: return value;
15: }
usage:
1: var ws = getClientSize();2: alert(ws.x + "," + ws.y);