右下角浮出层FF兼容问题! 在FF下不能用,是什么问题呢? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 在FF3.0下可以用, style.left, style.top 这2个属性是有单位的,要加上"px"<!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> 求教,几种JS框架的选择 JQ在连接的文字上弹出提示? IE9中external.menuArguments.location.href的问题 用javascript 获取基于webkitl浏览器链接网页所有内容 ext js tabPanel中验证问题 怎样才能得到下面的格式??? 发布一个网页截屏原代码,用于web截屏.图片直接传服务器收藏 一个鼠标跟随的效果,不知道哪错了,请大虾指教! 求一个好看的滚动条插件! 多文件上传 -- 这么多牛人难道没有会的吗 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>