在FF下不能用,是什么问题呢?
解决方案 »
- ie9 window调不到flash里面的方法
- js的问题 本人新手
- window.external.loadString和window.external.saveString是什么意思啊?
- js引用的问题
- 用JS怎么对货币格式的数据进行排序
- 高手请教:javascript导出excel如何不将隐藏列导出
- 各位大侠帮我看看这个简单的问题
- 一个VBSCRIPT 代码转化为JAVASCRIPT 的问题
- 急!!!!!!!!!如何判断一个窗口是否处于当前所有窗口的最前面????
- 问大伙一个很菜的问题,如何获取以名字命名的数组长度啊
- setTimeout里调用带有event参数的。为啥event不能当参数传啊?
- 求html页面左侧菜单
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>test</title>
</head>
<body leftmargin="0" topmargin="0" rightmargin="0" bottommargin="0">
<script type="text/javascript">
document.write('<DIV id=eMeng style="position:absolute;z-index:999;visibility:hidden;width:420px;height:336px;background-color:#ccc;">哈哈哈</DIV>');
window.onload = getMsg;
window.onresize = resizeDiv;
window.onerror = function(){}
var divTop,divLeft,divWidth,divHeight,docHeight,docWidth,objTimer,i = 0;
function getMsg()
{
try{
divTop = parseInt(document.getElementById("eMeng").style.top,10)
divLeft = parseInt(document.getElementById("eMeng").style.left,10)
divHeight = parseInt(document.getElementById("eMeng").offsetHeight,10)
divWidth = parseInt(document.getElementById("eMeng").offsetWidth,10)
docWidth = document.documentElement.clientWidth;
docHeight = document.documentElement.clientHeight;
document.getElementById("eMeng").style.top = parseInt(document.documentElement.scrollTop,10) + docHeight + 1 + "px";
document.getElementById("eMeng").style.left = parseInt(document.documentElement.scrollLeft,10) + docWidth - divWidth + "px";
document.getElementById("eMeng").style.visibility="visible"
objTimer = window.setInterval("moveDiv()",1)
}
catch(e){}
}
function resizeDiv()
{
i+=1
try{
divHeight = parseInt(document.getElementById("eMeng").offsetHeight,10)
divWidth = parseInt(document.getElementById("eMeng").offsetWidth,10)
docWidth = document.documentElement.clientWidth;
docHeight = document.documentElement.clientHeight;
document.getElementById("eMeng").style.top = docHeight - divHeight + parseInt(document.documentElement.scrollTop,10) + "px";
document.getElementById("eMeng").style.left = docWidth - divWidth + parseInt(document.documentElement.scrollLeft,10) + "px";
}
catch(e){}
}
function moveDiv()
{
try
{
if(parseInt(document.getElementById("eMeng").style.top,10) <= (docHeight - divHeight + parseInt(document.documentElement.scrollTop,10)))
{
window.clearInterval(objTimer)
objTimer = window.setInterval("resizeDiv()",1)
}
divTop = parseInt(document.getElementById("eMeng").style.top,10)
document.getElementById("eMeng").style.top = divTop - 10 + "px";
}
catch(e){}
}
function closeDiv()
{
document.getElementById('eMeng').innerHTML='';
document.getElementById('eMeng').style.visibility='hidden';
if(objTimer) window.clearInterval(objTimer)
}
setTimeout("closeDiv()",35000)
</script>
</body>
</html>