<div >
//获取滚动条高度
function getScrollTop() {
var scrollPos = 0;
if (typeof window.pageYOffset != 'undefined') {
scrollPos = window.pageYOffset;
}
else if (typeof window.document.compatMode != 'undefined' &&
window.document.compatMode != 'BackCompat') {
scrollPos = window.document.documentElement.scrollTop;
}
else if (typeof window.document.body != 'undefined') {
scrollPos = window.document.body.scrollTop;
}
return scrollPos;
}
function showTopDiv() {
if (document.getElementById("hidIsDelete") != null && document.getElementById("hidIsDelete").value == "1") {
var topDivBG = document.getElementById("topDivBG");
topDivBG.style.width = document.body.scrollWidth + "px";
topDivBG.style.height = document.body.scrollHeight + "px";
var topDivContent = document.getElementById("topDivContent");
var Conleft = document.body.offsetWidth / 2 - 200;
var Contop = document.documentElement.clientHeight / 2 + getScrollTop() - 80;
topDivContent.style.left = Conleft + "px";
topDivContent.style.top = Contop + "px";
//window.setTimeout(showTopDiv, 300);
}
}
function hiddenTopDiv() {
var topDivBG = document.getElementById("topDivBG");
topDivBG.style.display = "none";
}
function hiddenTopDiv() {
var topDivBG = document.getElementById("topDivBG");
topDivBG.style.display = "none";
}
</script>

相关文章: