Mercurial > projects > dang
comparison docs/candydoc/util.js @ 206:d3c148ca429b
Major moving of files. all src now goes into src, all docs in docs.
author | Anders Johnsen <skabet@gmail.com> |
---|---|
date | Tue, 12 Aug 2008 18:14:56 +0200 |
parents | doc/candydoc/util.js@4c121c2aa844 |
children |
comparison
equal
deleted
inserted
replaced
205:8387cbaa85ab | 206:d3c148ca429b |
---|---|
1 /* This file is a part of CanDyDOC fileset. | |
2 File is written by Victor Nakoryakov and placed into the public domain. | |
3 | |
4 This file is javascript with cross-browser utility functions. */ | |
5 | |
6 function getLeft(elem) | |
7 { | |
8 var ret = 0; | |
9 while (elem.offsetParent) | |
10 { | |
11 ret += elem.offsetLeft; | |
12 elem = elem.offsetParent; | |
13 } | |
14 | |
15 return ret; | |
16 } | |
17 | |
18 function getTop(elem) | |
19 { | |
20 var ret = 0; | |
21 while (elem.offsetParent) | |
22 { | |
23 ret += elem.offsetTop; | |
24 elem = elem.offsetParent; | |
25 } | |
26 | |
27 return ret; | |
28 } | |
29 | |
30 function getWindowHeight() | |
31 { | |
32 var ret = 0; | |
33 if (typeof(window.innerHeight) == "number") | |
34 ret = window.innerHeight; | |
35 else if (document.documentElement && document.documentElement.clientHeight) | |
36 ret = document.documentElement.clientHeight; | |
37 else if (document.body && document.body.clientHeight) | |
38 ret = document.body.clientHeight; | |
39 | |
40 return ret; | |
41 } |