Team:Goettingen/suplement/scripts ie ff patch

From 2013.igem.org

(Difference between revisions)
 
(6 intermediate revisions not shown)
Line 9: Line 9:
   return retnode;
   return retnode;
};  
};  
 +
 +
if (window.scrollY == null) {window.scrollY = document.documentElement.scrollTop}
function getNextElementSibling(ob){
function getNextElementSibling(ob){
Line 16: Line 18:
}
}
-
function getPageSize() {
+
if (!getComputedStyle) {
-
  var scrW, scrH;
+
    getComputedStyle = function(el, pseudo) {
-
  if(window.innerHeight && window.scrollMaxY) {
+
        this.el = el;
-
    // Mozilla
+
        this.getPropertyValue = function(prop) {
-
    scrW = window.innerWidth + window.scrollMaxX;
+
            var re = /(\-([a-z]){1})/g;
-
    scrH = window.innerHeight + window.scrollMaxY;
+
            if (prop == 'float') prop = 'styleFloat';
-
  } else if(document.body.scrollHeight > document.body.offsetHeight){
+
            if (re.test(prop)) {
-
    // all but IE Mac
+
                prop = prop.replace(re, function () {
-
    scrW = document.body.scrollWidth;
+
                    return arguments[2].toUpperCase();
-
    scrH = document.body.scrollHeight;
+
                });
-
  } else if(document.body) { // IE Mac
+
            }
-
    scrW = document.body.offsetWidth;
+
            return el.currentStyle[prop] ? el.currentStyle[prop] : null;
-
    scrH = document.body.offsetHeight;
+
        }
-
  }
+
        return this;
-
 
+
    }
-
  var winW, winH;
+
-
  if(window.innerHeight) { // all except IE
+
-
    winW = window.innerWidth;
+
-
    winH = window.innerHeight;
+
-
  } else if (document.documentElement
+
-
    && document.documentElement.clientHeight) {
+
-
    // IE 6 Strict Mode
+
-
    winW = document.documentElement.clientWidth;
+
-
    winH = document.documentElement.clientHeight;
+
-
  } else if (document.body) { // other
+
-
    winW = document.body.clientWidth;
+
-
    winH = document.body.clientHeight;
+
-
  }
+
-
 
+
-
  // for small pages with total size less then the viewport
+
-
  var pageW = (scrW<winW) ? winW : scrW;
+
-
  var pageH = (scrH<winH) ? winH : scrH;
+
-
 
+
-
  return {PageW:pageW, PageH:pageH, WinW:winW, WinH:winH};
+
}
}
</script>
</script>
</html>
</html>

Latest revision as of 11:35, 15 September 2013