当有数据更新浏览器右下角弹出消息框提示 怎么用asp.net弄 ? 如果用js或popupwin第三方控件有具体怎么做?
解决方案 »
- input 的问题
- gridview嵌套gridview再嵌套CheckBox,要如何触发CheckBox的OnCheckedChanged事件?
- 在一个类里写的递归为什么不行??
- sqlserver 中实现汉字“同音”查询
- 防火墙使用不当会导致网页出现乱码吗?
- 谁帮我解释这个正则表达式
- 有关DataGird分页的问题,高手赐教哈!!!
- 无法找到脚本库“/aspnet_client/system_web/1_1_4322/webuivalidation.js”(在线等)
- 请看这个错误该如何更正呢?
- 疯了,死活无法给模板列控件的赋值!!!!!!(60分)
- 代码框中每行代码前面都自动带有虚线和箭头,不知道是什么原因?
- HttpContext.Current.Application["arg"]跨页面问题?
http://www.codefans.net/soft/4545.shtml
http://www.jb51.net/article/25951.htm
很符合楼主要求!有源码
1、搜集并整理EeekSoft.Web.PopupWin.dll文件及源文件
2、转换代码为VS2005环境下可以应用,可以顺利编译
3、对原有内容进行汉化整理,工具演示更清晰明了
4、培养演示视频(敬请留意源码评论)
以下为51aspx上原功能描述:
1:动画方式弹出,就像MSN的提示框
2:漂亮,详细见配图
3:还可以再在开一个更加详细的内容网页
4:自动关闭,无需手工确认那个ok
5:示例包括C#和VB两个版本,popUp的源文件在EeekSoft.Web.PopupWin文件夹中
6:用起来简单(具体使用方法见代码佩文),示例使用前请先编译
window.onresize = resizeDiv; //根据窗体高度和宽度,改变短消息提示框的高度和宽度
window.onerror = function(){} //出现错误时,不做任何处理
var divTop,divLeft,divWidth,divHeight,docHeight,docWidth,objTimer,i = 0;//关于位置的相关变量
function $int(num){try{return parseInt(num);}catch(ex){return 0;}}
function viewMsg() {
try{
var divElement = $(divName);
divTop = $int(divElement.style.top) //div的x坐标
divLeft = $int(divElement.style.left) //div的y坐标
divHeight = $int(divElement.offsetHeight)//div的高度
divWidth = $int(divElement.offsetWidth) //div的宽度
docWidth = document.documentElement.clientWidth; //窗体宽度
docHeight = document.documentElement.clientHeight; //窗体高度
divElement.style.top = docHeight + 10;//设置div的Y坐标
divElement.style.left = docWidth - divWidth//设置div的X坐标
divElement.style.visibility="visible" //设置div显示
objTimer = window.setInterval("moveDiv()",10) //设置定时器
}catch(e){alert("viewMsg"+e.description);}
}
function resizeDiv(){
i+=1
if (i>500) closeDiv()
try{
var divElement = $(divName);
divHeight = $int(divElement.offsetHeight) //设置div高度
divWidth = $int(divElement.offsetWidth) //设置div宽度
docWidth = document.documentElement.clientWidth; //获取窗体宽度
docHeight = document.documentElement.clientHeight; //设置窗体高度
divElement.style.top = docHeight - divHeight;// + $int(document.body.scrollTop)//设置div的y坐标
divElement.style.left = docWidth - divWidth;// + $int(document.body.scrollLeft)//设置div的x坐标
}catch(e){alert("resizeDiv"+e.description);}
}
function moveDiv(){
try{
var divElement = $(divName);
if ($int(divElement.style.top) <= (docHeight - divHeight)){
window.clearInterval(objTimer)
objTimer = window.setInterval("resizeDiv()",1) //调整div的位置和大小
}
divTop = $int(divElement.style.top)//获取y坐标
divElement.style.top = divTop - 1//调整div的Y坐标
}
catch(e){alert("moveDiv"+e.description);}
}
function closeDiv(){
var divElement = $(divName);
divElement.style.visibility='hidden';//将短信息提示层隐藏
if(objTimer) window.clearInterval(objTimer); //清除定时器
} 单独的JS文件,保存并在页面引用
<div id="divMsg" style="border-right: #455690 1px solid; border-top: #a6b4cf 1px solid;
z-index: 99999; left: 0px; visibility: hidden; border-left: #a6b4cf 1px solid;
width: 180px; border-bottom: #455690 1px solid; position: absolute; top: 0px;
height: 116px; background-color: #c9d3f3">
<table style="border-top: #ffffff 1px solid; border-left: #ffffff 1px solid" cellspacing="0"
cellpadding="0" width="100%" bgcolor="#cfdef4" border="0">
<tbody>
<tr>
<td style="font-size: 12px; color: #0f2c8c" width="30" height="24">
</td>
<td style="font-weight: normal; font-size: 12px; color: #1f336b; padding-top: 4px;
padding-left: 4px" valign="center" width="100%">
Mac审批提示:</td>
<td style="padding-top: 2px; padding-right: 2px" valign="center" align="right" width="19">
<span title="关闭" style="cursor: hand; color: red; font-size: 12px; font-weight: bold;
margin-right: 4px;" onclick="closeDiv()">×</span></td>
</tr>
<tr>
<td style="padding-right: 1px; padding-bottom: 1px" colspan="3" height="90">
<div style="border-right: #b9c9ef 1px solid; padding-right: 13px; border-top: #728eb8 1px solid;
padding-left: 13px; font-size: 12px; padding-bottom: 13px; border-left: #728eb8 1px solid;
width: 100%; color: #1f336b; padding-top: 18px; border-bottom: #b9c9ef 1px solid;
height: 100%">
有<font color="#FF0000"><%= msgCount.ToString() %></font>条Mac申请待您审批!<br>
<br>
<div align="center" style="word-break: break-all">
<a href='ComMacApply.aspx?Com_ID=<%= Com_ID %>' target="_blank"><font color="#FF0000">点击查看申请</font></a></div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<script type="text/javascript" language="javascript">
var divName="divMsg";
window.onload=function(){
var hid = $('<%= hidMsg.ClientID %>');
if(hid.value!="0")
hid.fireEvent("onclick");//主要就是这个了,以后如果有数据更新,就触发一次hidMsg的onclick事件
}
</script>
$("div").html("有" + data + "条Mac申请待您审批!")
前台代码 能否详细一些 呵呵 比如说当数据库中某表数据有更新 消息框就从右下角弹出 关于<input type="hidden" onclick="viewMsg()" runat="server" id="hidMsg" value="0" />
其中value="0" 值的变化是由谁触发的, 而且我也发现代码运行时 系统提示 "resizeDiv() style” 不存在
无需任何服务器控件
写个div
有信息就显示这个div