发新话题
打印

右下脚随滚动条活动的div提示信息(修正)

右下脚随滚动条活动的div提示信息(修正)

<SCRIPT language=javascript>
window.onload = enetgetMsg;
window.onresize = enetresizeDiv;
window.onerror = function(){}
var enetdivTop,enetdivLeft,enetdivWidth,enetdivHeight,enetdocHeight,enetdocWidth,enetobjTimer,i = 0;
function enetgetMsg() {
try {
  enetdivTop = parseInt(document.getElementById("enetMeng").style.top,10);
  enetdivLeft = parseInt(document.getElementById("enetMeng").style.left,10);
  enetdivHeight = parseInt(document.getElementById("enetMeng").offsetHeight,10);
  enetdivWidth = parseInt(document.getElementById("enetMeng").offsetWidth,10);
  enetdocWidth = document.documentElement.clientWidth;
  enetdocHeight = document.documentElement.clientHeight;
  document.getElementById("enetMeng").style.top = parseInt(document.body.scrollTop,10) + enetdocHeight + 10;// enetdivHeight
  document.getElementById("enetMeng").style.left = parseInt(document.body.scrollLeft,10) + enetdocWidth - enetdivWidth;
  document.getElementById("enetMeng").style.visibility="visible";
  enetobjTimer = window.setInterval("enetmoveDiv()",10);
}
catch(e){}
}
 
function enetresizeDiv() {
i += 1;
if(i > 800) enetcloseDiv();
try {
  enetdivHeight = parseInt(document.getElementById("enetMeng").offsetHeight,10);
  enetdivWidth = parseInt(document.getElementById("enetMeng").offsetWidth,10);
  enetdocWidth = document.documentElement.clientWidth;
  enetdocHeight = document.documentElement.clientHeight;
  document.getElementById("enetMeng").style.top = enetdocHeight - enetdivHeight + parseInt(document.documentElement.scrollTop,10);
  document.getElementById("enetMeng").style.left = enetdocWidth - enetdivWidth + parseInt(document.documentElement.scrollLeft,10);
}
catch(e){}
}
function enetmoveDiv() {
try {
  if(parseInt(document.getElementById("enetMeng").style.top,10) <= (enetdocHeight - enetdivHeight + parseInt(document.documentElement.scrollTop,10))) {
   window.clearInterval(enetobjTimer);
   enetobjTimer = window.setInterval("enetresizeDiv()",1);
  }
  enetdivTop = parseInt(document.getElementById("enetMeng").style.top,10);
  document.getElementById("enetMeng").style.top = enetdivTop - 1;
} catch(e){}
}
function enetcloseDiv() {
document.getElementById('enetMeng').style.visibility='hidden';
if(enetobjTimer) window.clearInterval(enetobjTimer);
}
</SCRIPT>
<DIV id=enetMeng
style="BORDER-RIGHT: #455690 1px solid; BORDER-TOP: #a6b4cf 1px solid; Z-INDEX: 99999; LEFT: 0px; VISIBILITY: visible;BORDER-LEFT: #a6b4cf 1px solid; 1px solid; POSITION: absolute; TOP: -256px; width: 150px;">
<img src="{$Think.config.IMAGES_URL}/public/khtw_01.gif" width="150" alt="关闭"/>
<a href="{$Think.config.NEW52CP_ROOT}/common/index.php/Service" target="_blank"><img src="{$Think.config.IMAGES_URL}/public/khtw_02.gif" width="150" alt="双彩网客户提问"/></a>
</div>

TOP

发新话题