[转贴]现在在做一个WEB的站内消息系统,从工具栏位置弹出一徐徐上升的窗口
2005-09-07 16:08
375 查看
现在在做一个WEB的站内消息系统,
想在用户登陆时,
如果有未读短消息
则从工具栏位置弹出一徐徐上升的窗口
显示提醒信息!
<script language="JavaScript" type="text/javascript">
var divTop,divLeft,divWidth,divHeight,docHeight,docWidth,objTimer,i = 0;
function getMsg()
{
try{
window.open("Top.aspx","TopMusic");
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.body.clientWidth;
docHeight = document.body.clientHeight;
document.getElementById("eMeng").style.top = parseInt(document.body.scrollTop,10) + docHeight + 10;// divHeight
document.getElementById("eMeng").style.left = parseInt(document.body.scrollLeft,10) + docWidth - divWidth
document.getElementById("eMeng").style.visibility="visible"
objTimer = window.setInterval("moveDiv()",10)
}
catch(e){}
}
function resizeDiv()
{
i+=1
if(i>1288) closeDiv()
try{
divHeight = parseInt(document.getElementById("eMeng").offsetHeight,10)
divWidth = parseInt(document.getElementById("eMeng").offsetWidth,10)
docWidth = document.body.clientWidth;
docHeight = document.body.clientHeight;
document.getElementById("eMeng").style.top = docHeight - divHeight + parseInt(document.body.scrollTop,10)
document.getElementById("eMeng").style.left = docWidth - divWidth + parseInt(document.body.scrollLeft,10)
}
catch(e){}
}
function moveDiv()
{
try
{
if(parseInt(document.getElementById("eMeng").style.top,10) <= (docHeight - divHeight + parseInt(document.body.scrollTop,10)))
{
window.clearInterval(objTimer)
objTimer = window.setInterval("resizeDiv()",1)
}
divTop = parseInt(document.getElementById("eMeng").style.top,10)
document.getElementById("eMeng").style.top = divTop - 1
}
catch(e){}
}
function closeDiv()
{
document.getElementById('eMeng').style.visibility='hidden';
if(objTimer) window.clearInterval(objTimer)
}
window.onload = getMsg;
window.onresize = resizeDiv;
window.onerror = function(){}
</script>
相关连接:
http://www.eeeksoft.net/files/popuptest/Default.aspx
想在用户登陆时,
如果有未读短消息
则从工具栏位置弹出一徐徐上升的窗口
显示提醒信息!
<script language="JavaScript" type="text/javascript">
var divTop,divLeft,divWidth,divHeight,docHeight,docWidth,objTimer,i = 0;
function getMsg()
{
try{
window.open("Top.aspx","TopMusic");
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.body.clientWidth;
docHeight = document.body.clientHeight;
document.getElementById("eMeng").style.top = parseInt(document.body.scrollTop,10) + docHeight + 10;// divHeight
document.getElementById("eMeng").style.left = parseInt(document.body.scrollLeft,10) + docWidth - divWidth
document.getElementById("eMeng").style.visibility="visible"
objTimer = window.setInterval("moveDiv()",10)
}
catch(e){}
}
function resizeDiv()
{
i+=1
if(i>1288) closeDiv()
try{
divHeight = parseInt(document.getElementById("eMeng").offsetHeight,10)
divWidth = parseInt(document.getElementById("eMeng").offsetWidth,10)
docWidth = document.body.clientWidth;
docHeight = document.body.clientHeight;
document.getElementById("eMeng").style.top = docHeight - divHeight + parseInt(document.body.scrollTop,10)
document.getElementById("eMeng").style.left = docWidth - divWidth + parseInt(document.body.scrollLeft,10)
}
catch(e){}
}
function moveDiv()
{
try
{
if(parseInt(document.getElementById("eMeng").style.top,10) <= (docHeight - divHeight + parseInt(document.body.scrollTop,10)))
{
window.clearInterval(objTimer)
objTimer = window.setInterval("resizeDiv()",1)
}
divTop = parseInt(document.getElementById("eMeng").style.top,10)
document.getElementById("eMeng").style.top = divTop - 1
}
catch(e){}
}
function closeDiv()
{
document.getElementById('eMeng').style.visibility='hidden';
if(objTimer) window.clearInterval(objTimer)
}
window.onload = getMsg;
window.onresize = resizeDiv;
window.onerror = function(){}
</script>
相关连接:
http://www.eeeksoft.net/files/popuptest/Default.aspx
相关文章推荐
- 现在在做一个WEB的站内消息系统,从工具栏位置弹出一徐徐上升的窗口
- 用xmlhttp和Java session监听改善站内消息系统,实现站内消息弹出窗口
- VB.Net + asp.net的一个web系统,使用SQL2000数据库 现在运行时偶尔会出现一个奇怪现象,一个用户登录时,登录后的界面竟然是另一个用户
- XMLHTTP通信,开发一个较为完善的站内消息系统
- 弹出一个不带地址栏、工具栏的IE非模态窗口
- 禁用开机时弹出窗口“ 服务控制管理器:在系统启动时至少一个服务或驱动程序产生错误”
- 关闭或重启Windows Server 操作系统时,系统会弹出一个提示窗口
- xp系统关闭远程桌面时,弹出一个窗口,提示"正在重新连接"
- 分析器错误消息: 未能加载文件或程序集“System.WEB.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35”或它的某一个依赖项。系统找不到指定的文件。
- 如何做一个弹出窗口,现在很多都流行这样做
- 用WindowFromPoint()函数来获得鼠标所在位置的窗口的句柄--发生一个关闭窗口的消息---关闭鼠标所在的窗口
- 两个小知识点(始终弹出一个窗口、滚动条停在当前位置),分享下!
- [转载]弹出一个不带地址栏、工具栏的IE非模态窗口
- ASP.net 让窗口WEB打开后,弹出一个选择窗口供应选择,注意Page_Load顺序,JS产生的找不到对象的问题
- 向一个指定窗口发送左键按下的消息,同时将左键按下的位置也发过去(譬如要编写连连看程序的外挂)
- (转载)两个小知识点(始终弹出一个窗口、滚动条停在当前位置),分享下!
- 从头开始构建一个web即时通讯系统 - 客户端 - flash socket
- 最近距离 已知平面上的若干点的位置,存入一个List中。现在需要计算所有这些点中,距离最近的两个点间的最小距离。
- 一个简单web系统的接口性能分析及调优过程
- 获取一个控件相对于父窗口的坐标位置