ASP.NET 弹出提示窗口,像QQ那种

wuyan16001 2009-04-24 02:46:25
在asp.net中,怎么样可以在登陆系统后自动弹出一个提示窗口,之后在规定的时间内消失。像QQ在电脑右下角会弹出提示窗口那样
...全文
1077 15 打赏 收藏 转发到动态 举报
写回复
用AI写文章
15 条回复
切换为时间正序
请发表友善的回复…
发表回复
gzto020 2009-04-27
  • 打赏
  • 举报
回复
popupwin控件,到网上搜一下
peng_weida 2009-04-27
  • 打赏
  • 举报
回复
up
jxdyzwh 2009-04-27
  • 打赏
  • 举报
回复
网上很多资料的,去cnblog搜索下,我的东西就是在那里找的,然后自已改了点东西
wsj1983920 2009-04-27
  • 打赏
  • 举报
回复
up
can_er008 2009-04-27
  • 打赏
  • 举报
回复
顶6楼,虽然还有很多东西需要改进。
major 2009-04-27
  • 打赏
  • 举报
回复
有个控件叫popupwin控件蛮不错的,你可以下载来试试。
冬你个冬 2009-04-27
  • 打赏
  • 举报
回复
[Quote=引用 6 楼 yfqvip 的回复:]
HTML code<!-- saved from url=file://C:/Documents and Settings/yfq/桌面/升起窗口提示.html -->
<script>
window.onerror = new Function("return(false);")
</script><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<HTML><HEAD><TITLE>类似MSN提示的页面效果</TITLE></HEAD>

<BODY scroll=no><!--StartFragment-->看到右下角的提示了吗?如果没有看到,<BUTTON onclick=location.reload();>刷新…
[/Quote]
这个我测试了下 不错
llsen 2009-04-24
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 xiaojing7 的回复:]
HTML code
<style type="text/css">
<!--
#xx{ position:absolute; width:200px;;border:1px solid #999999;}
#title{font-size:12px;height:30px;width:100%;background:#0099FF;}
#content{font-size:12px;height:170px;width:100%;}
-->
</style>
<script>
var Initialization =true //判断div是否滚动下去了 true没下去 false下去了
var Opacity =100 //设置透明度
var i=0 …
[/Quote]

up楼上
满衣兄 2009-04-24
  • 打赏
  • 举报
回复
http://cn-asp.net/n38c11.aspx
这个很漂亮的!
满衣兄 2009-04-24
  • 打赏
  • 举报
回复
<!-- saved from url=file://C:/Documents and Settings/yfq/桌面/升起窗口提示.html -->
<script>
window.onerror = new Function("return(false);")
</script><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<HTML><HEAD><TITLE>类似MSN提示的页面效果</TITLE></HEAD>

<BODY scroll=no><!--StartFragment-->看到右下角的提示了吗?如果没有看到,<BUTTON onclick=location.reload();>刷新</BUTTON>一下
<SCRIPT language=JavaScript>
window.onload = getMsg;
window.onresize = resizeDiv;
window.onerror = function(){}
//短信提示使用(asilas添加)
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.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>500) 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)
}
</SCRIPT>

<DIV id=eMeng
style="BORDER-RIGHT: #455690 1px solid; BORDER-TOP: #a6b4cf 1px solid; Z-INDEX: 99999; LEFT: 840px; VISIBILITY: hidden; BORDER-LEFT: #a6b4cf 1px solid; WIDTH: 180px; BORDER-BOTTOM: #455690 1px solid; POSITION: absolute; TOP: 483px; 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; BACKGROUND-IMAGE: url(msgTopBg.gif); COLOR: #0f2c8c"
width=30 height=24></TD>
<TD
style="PADDING-LEFT: 4px; FONT-WEIGHT: normal; FONT-SIZE: 12px; BACKGROUND-IMAGE: url(msgTopBg.gif); COLOR: #1f336b; PADDING-TOP: 4px"
vAlign=center width="100%">短消息提示: </TD>
<TD
style="PADDING-RIGHT: 2px; BACKGROUND-IMAGE: url(msgTopBg.gif); PADDING-TOP: 2px"
vAlign=center align=right width=19><SPAN title=关闭
style="FONT-WEIGHT: bold; FONT-SIZE: 12px; CURSOR: hand; COLOR: red; MARGIN-RIGHT: 4px"
onclick=closeDiv()>× </SPAN><!-- <IMG title=关闭 style="CURSOR: hand" onclick=closeDiv() hspace=3 src="msgClose.jpg"> --></TD></TR>
<TR>
<TD
style="PADDING-RIGHT: 1px; BACKGROUND-IMAGE: url(1msgBottomBg.jpg); 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>1 </FONT>封新短消息 <BR><BR>
<DIV style="WORD-BREAK: break-all" align=center><A
href="javascript:alert('你好')"><FONT color=#ff0000>点击查看短信
</FONT></A></DIV></DIV></TD></TR></TBODY></TABLE></DIV><!--EndFragment--></BODY>
</HTML>
冬你个冬 2009-04-24
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 takako_mu 的回复:]
div+settimeout
[/Quote]
就是这个方法
然后在settimeout 调用的事件中 style="display:none"
xiaojing7 2009-04-24
  • 打赏
  • 举报
回复
[CODE=HTML]
<style type="text/css">
<!--
#xx{ position:absolute; width:200px;;border:1px solid #999999;}
#title{font-size:12px;height:30px;width:100%;background:#0099FF;}
#content{font-size:12px;height:170px;width:100%;}
-->
</style>
<script>
var Initialization =true //判断div是否滚动下去了 true没下去 false下去了
var Opacity =100 //设置透明度
var i=0 //移动的次数 根据长度算和移动速度算出来的
window.onresize = resizeDiv;
window.onscroll = resizeDiv;
function resizeDiv()
{
divHeight = parseInt(document.getElementById("xx").offsetHeight,10);
divWidth = parseInt(document.getElementById("xx").offsetWidth,10);
docWidth = document.body.clientWidth;
docHeight = document.body.clientHeight;
if(Initialization)
{document.getElementById("xx").style.top = docHeight + parseInt(document.body.scrollTop,10) - divHeight ;
document.getElementById("xx").style.left = docWidth + parseInt(document.body.scrollLeft,10) - divWidth;}
else
{
document.getElementById("xx").style.top = docHeight + parseInt(document.body.scrollTop,10) - divHeight;
}
}

function move(){
if(Initialization)
{ if(i!=34)
{
i++;
document.getElementById("xx").style.top=parseInt(document.getElementById("xx").style.top)+5
tt=setTimeout("move()",10)
}
else
{window.clearTimeout(tt); Initialization=false;document.getElementById("content").style.display = "none";}
}
else
{
if(i!=0)
{
document.getElementById("content").style.display = "";
i--
document.getElementById("xx").style.top=parseInt(document.getElementById("xx").style.top)-5
tt=setTimeout("move()",10)
}
else
{Initialization=true;window.clearTimeout(tt)}
}
}

function disappear(){
if(Opacity==0)
{window.clearTimeout(time);
document.getElementById('xx').style.display="none";}
else
{
Opacity=Opacity-10;
document.getElementById('xx').style.filter = "Alpha(opacity="+Opacity+")";
time=setTimeout("disappear()",50)
}
}
</script>



<body onload="resizeDiv()">
hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>
<div id="xx">
<div id="title">
<span style="top:7px;left:10px; position:relative;">新闻列表</span>
<span style="top:7px;left:105px; position:relative; cursor:hand;" onClick="move()">--</span>
<span style="top:7px;left:110px; position:relative; cursor:hand;" onClick="disappear()">X</span>
</div>
<div id="content"></div>
</div>
</body>
[/code]
zpphao 2009-04-24
  • 打赏
  • 举报
回复
这个要用JS做的;有点复杂..如果会JS又会写CSS的话那就好办了..
yytt123622 2009-04-24
  • 打赏
  • 举报
回复
提示框用div做,获取消息就要定时刷新了!
takako_mu 2009-04-24
  • 打赏
  • 举报
回复
div+settimeout

62,267

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧