summaryrefslogtreecommitdiffstats
path: root/bubble.js
diff options
context:
space:
mode:
authorAndreas Unterkircher <unki@netshadow.at>2007-06-07 10:00:01 +0000
committerAndreas Unterkircher <unki@netshadow.at>2007-06-07 10:00:01 +0000
commit379cde9ab362700327b496aa9aa7c612036b298e (patch)
tree05c489837a5d7d8b8defa11c6c8587b92f0965c1 /bubble.js
parent1f8f27b4ac3afc282c9d7aecd91953498a40f8ee (diff)
improved up/down handling of bubble
git-svn-id: file:///var/lib/svn/phpfspot/trunk@36 fa6a889d-dae6-447d-9e79-4ba9a3039384
Diffstat (limited to 'bubble.js')
-rw-r--r--bubble.js34
1 files changed, 32 insertions, 2 deletions
diff --git a/bubble.js b/bubble.js
index 74ad460..600407b 100644
--- a/bubble.js
+++ b/bubble.js
@@ -62,11 +62,11 @@ function attachBubble(_b){
document.getElementsByTagName("body")[0].appendChild(_10);
_10.className="bubble";
- _iH = window.innerHeight;
var _e=findPos(_c)[0]+5;
+ var cur_height = findPos(_c)[1]-get_scroll_position() + 283;
// should the bubble be displayed above or below the object
- if(findPos(_c)[1] + 240 >= _iH) {
+ if(cur_height >= get_page_height()) {
var _f=findPos(_c)[1]-283;
var _mT=16;
var _mL=12;
@@ -273,5 +273,35 @@ function var_dump(obj) {
}
}//end function var_dump
+function get_page_height()
+{
+ var myHeight = 0;
+ if( typeof( window.innerHeight ) == 'number' ) {
+ //Non-IE
+ myHeight = window.innerHeight;
+ } else if( document.documentElement && document.documentElement.clientHeight ) {
+ //IE 6+ in 'standards compliant mode'
+ myHeight = document.documentElement.clientHeight;
+ } else if( document.body && document.body.clientHeight ) {
+ //IE 4 compatible
+ myHeight = document.body.clientHeight;
+ }
+
+ return myHeight;
+}
+
+function get_scroll_position()
+{
+
+ if (typeof window.pageYOffset != 'undefined')
+ return window.pageYOffset;
+ else
+ if (typeof document.compatMode != 'undefined' && document.compatMode != 'BackCompat')
+ return window.scrollTop;
+ else
+ if (typeof document.body != 'undefined')
+ return document.body.scrollTop;
+
+}
BrowserDetect.init();