Team:Tianjin/header

From 2012.igem.org

(Difference between revisions)
Line 44: Line 44:
else{
else{
document.getElementById("secondpane").className="menu_list";
document.getElementById("secondpane").className="menu_list";
 +
}
 +
}
 +
window.onscroll=getScrollTop;
 +
</script>
 +
function getScrollTop() {
 +
    var scrollPos;
 +
    if (window.pageYOffset) {
 +
        scrollPos = window.pageYOffset;
 +
    }
 +
    else if (document.compatMode) {
 +
    if(document.compatMode != 'BackCompat')
 +
    {
 +
        scrollPos = document.documentElement.scrollTop;
 +
        }
 +
        else if (document.body)
 +
        {
 +
        scrollPos = document.body.scrollTop;
 +
    }
 +
    }
 +
    if(scrollPos < 110){
 +
document.getElementById("right-fixed").className=" ";
 +
}
 +
else{
 +
document.getElementById("right-fixed").className="right-fixed";
}
}
}
}

Revision as of 11:10, 23 September 2012

function getScrollTop() { var scrollPos; if (window.pageYOffset) { scrollPos = window.pageYOffset; } else if (document.compatMode) { if(document.compatMode != 'BackCompat') { scrollPos = document.documentElement.scrollTop; } else if (document.body) { scrollPos = document.body.scrollTop; } } if(scrollPos < 110){ document.getElementById("right-fixed").className=" "; } else{ document.getElementById("right-fixed").className="right-fixed"; } } window.onscroll=getScrollTop;