怎么实现这个效果啊,急!!!!!
我点击页面上一个按钮,从浏览器右下角浮起一个小框。显示一些信息,就像一些即时通信软件来消息以后浮起个框,显示消息的内容。
[解决办法]
参考
http://www.msproject.cn/Article/Web_Popup_Window.aspx
[解决办法]
给你个js例子!稍微再改改!就可以了!
<html>
<head>
<meta http-equiv= "Content-Type " content= "text/html; charset=gb2312 ">
<meta name= "GENERATOR " content= "Microsoft FrontPage 4.0 ">
<meta name= "ProgId " content= "FrontPage.Editor.Document ">
<title> New Page 1 </title>
<style type= "text/css ">
<!--.link {
color : #000000;
text-decoration : none;
}A.link:hover {
color : red;
}A.link:active {
color : #000000;
text-decoration : none;
}//-->
</style>
<style type= "text/css ">
<!--
#slidemenubar2{position:absolute;left:-110pt;width:120pt;top:100pt;border:1.5pt solid black;
background-color:#ffffff;layer-background-color:#ffffff;font: 9pt/20pt "宋体 ";}
body { font-size: 9pt; margin: 0pt}
#slidemenubar { position:absolute;
left:-110pt;width:120pt;top:100pt;border:1.5pt black solid;background-color:#F3F3F3;layer-background-color:lightyellow;
font: 9pt/20pt "宋体 "; }
//-->
</style>
</head>
<body>
<script language= "JavaScript1.2 ">
if (document.all)
document.write( ' <div id= "slidemenubar2 " style= "left:-100 " onMouseover= "pull() " onMouseout= "draw() "> ')
</script>
<layer id= "slidemenubar " onMouseover= "pull() " onMouseout= "draw() "> <script language= "JavaScript1.2 ">
var sitems=new Array()
var sitemlinks=new Array()
//以下是菜单内容,自由设置;
sitems[0]= "本站首页 "
sitems[1]= "最新更新 "
sitems[2]= "梦想软件 "
sitems[3]= "其它栏目 "
sitems[4]= "桌面壁纸 "
sitems[5]= "给我留言 "
sitems[6]= "下载特区 "
sitems[7]= "Email Me "
sitems[8]= "我的简介 "
//菜单项目连接
sitemlinks[0]= "http://www.happydrips.com "
sitemlinks[1]= "http://www.abc.com "
sitemlinks[2]= "http://abc.ab.com "
sitemlinks[3]= "../index.htm "
sitemlinks[4]= "../jsschool/index.htm "
sitemlinks[5]= "../../../gsbook.htm "
sitemlinks[6]= "../../../perl/index.htm "
sitemlinks[7]= "mailto:yshot@263.net "
sitemlinks[8]= "http://www.happydrips.com "
for (i=0;i <=sitems.length-1;i++)
document.write( ' <a href= '+sitemlinks[i]+ '> '+sitems[i]+ ' </a> <br> ')
</script>
</layer>
<script language= "JavaScript1.2 ">
function regenerate()
{
window.location.reload()
}
function regenerate2()
{
if (document.layers)
setTimeout( "window.onresize=regenerate ",400)
}
window.onload=regenerate2
if (document.all)
{
document.write( ' </div> ')
themenu=document.all.slidemenubar2.style
rightboundary=0
leftboundary=-150
}
else
{
themenu=document.layers.slidemenubar
rightboundary=150
leftboundary=10
}
function pull()
{
if (window.drawit)
clearInterval(drawit)
pullit=setInterval( "pullengine() ",50)
}
function draw()
{
clearInterval(pullit)
drawit=setInterval( "drawengine() ",50)
}
function pullengine()
{
if (document.all&&themenu.pixelLeft <rightboundary)
themenu.pixelLeft+=5
else if(document.layers&&themenu.left <rightboundary)
themenu.left+=5
else if (window.pullit)
clearInterval(pullit)
}
function drawengine()
{
if (document.all&&themenu.pixelLeft> leftboundary)
themenu.pixelLeft-=5
else if(document.layers&&themenu.left> leftboundary)
themenu.left-=5
else if (window.drawit)
clearInterval(drawit)
}
</script>
</body>
</html>
[解决办法]
Javascript+DIV
如果是实时消息,可以采用AJAX
[解决办法]
有这种控件,可以下载
[解决办法]
mark
[解决办法]
考虑一个经典+流行控件
ASP.NET Popup Control
http://www.codeproject.com/aspnet/asppopup.asp
[解决办法]
JS+DIV自己去网上找吧
[解决办法]
Popup Control
[解决办法]
js
以下仅供参考
function InitMsgBox(hint)
{
len = 0;
titlePopup=window.createPopup();
var titlePopupBody = titlePopup.document.body;
titlePopupBody.style.border = "solid #ffffff 1px ";
var titleContent = " ";
titleContent = titleContent + " <table width=180 border=0 cellspacing=0 cellpadding=0> ";
titleContent = titleContent + " <tr> <td height=25 bgcolor=#1182E8 style=\ "font-size:12px; font-weight:bold; color:#FFFFFF; padding-left:5px; letter-spacing:0.2em\ "> 提示信息 </td> </tr> ";
titleContent = titleContent + " <tr> <td height=25 word-wrap=wrap bgcolor=#F5FAFE style=\ "font-size:12px; color:#FF0000;font-weight:bold; padding-left:5px; border-left:1px #0C68CF solid; border-right:1px solid #0C68CF;\ "> " + hint + " </td> </tr> ";
solid #0C68CF\ "> </td> </tr> ";
titleContent = titleContent + " </table> ";
titlePopupBody.innerHTML = titleContent;
ShowMsgBox();
}
function MsgBox()
{
len += 4;
if (len > 110)
{
window.clearInterval(tID);
}
else
{
//170固定了消息提示框的宽度
// titlePopup.show(document.body.clientWidth - 170, document.body.clientHeight - len, 170, len, top.document.body);
titlePopup.show(window.screen.width - 170, window.screen.height - len, 170, len, top.document.body);
}
}
var tID
function ShowMsgBox()
{
tID = window.setInterval( "MsgBox() ",10);
}
[解决办法]
mark学习
[解决办法]
EeekSoft.Web.PopupWin.dll这个控件可以,如果不想写js和div的话。
[解决办法]
顶,我也是用EeekSoft.Web.PopupWin.dll
[解决办法]
顶一下啦,看来大家都挺关注这种效果的实现
[解决办法]
/// <summary>
/// 生成脚本块的方法
/// 感谢原先的作者,非常感谢!
/// </summary>
/// <param name= "awakeTable "> </param>
/// <returns> string </returns>
/// <author> zhanglei@hrbanlv.com </author>
private string RegisterScript(DataTable awakeTable)
{
if (stopAwakeFlag.Value == "1 ")
{
return " ";
}
StringBuilder sb = new StringBuilder();
//增加try..catch,使ie5中因不支持window.createPopup(),而不报错
sb.Append( " <script language= 'javascript '> " + System.Environment.NewLine);
sb.Append( "try { " + System.Environment.NewLine);
sb.Append( "var have = 1; " + System.Environment.NewLine);
sb.Append( "var testid=0; " + System.Environment.NewLine);
sb.Append( "var oldWin= window; " + System.Environment.NewLine);
sb.Append( "var oPopup = window.createPopup(); " + System.Environment.NewLine);
sb.Append( "var opopupi = 0; " + System.Environment.NewLine);
sb.Append( "var showttt=null; " + System.Environment.NewLine);
sb.Append( "var oPopBody = oPopup.document.body; " + System.Environment.NewLine);
sb.Append( "oPopBody.style.backgroundColor= 'transparent '; " + System.Environment.NewLine);
sb.Append( "oPopBody.style.border = 'none '; " + System.Environment.NewLine);
//sb.Append( "oPopBody.innerHTML=\ " <div style= 'font-size:9pt '> <img src= '../../images/awakeMessage.gif '> <font color= '#000000 '> <b> <div align= 'right ' valign= 'center '> <a style= 'cursor:hand ' onclick= 'parent.oPopup.hide(); '> <image src= '../../images/icon_logout.gif ' alt= '关闭 '> </a> </div> </b> </font> ");
////=======================================================================
//// ***** [ADDED BY DoItNow, 2005/8/27] 加入 选择筐 控制是否 显示提醒
////-----------------------------------
//sb.Append( " <div align=left> <a onclick= 'javascript:StopAwake() ' href= '# '> 不在提示 </a> </div> ");
//=======[ADDED END]=====================================================
//int tempAwakeCount= awakeTable.Rows.Count;
//sb.Append( " <br> 您有 <font color= '#ff0000 '> "+tempAwakeCount + " </font> 条未读提醒: <a style= 'cursor:hand ' onclick= 'javascript:window.parent.parent.frmbotton1.location.href=\\\ "AwakeList.aspx\\\ "; '> [详细] </a> ");
//for(int i=0;i <tempAwakeCount&&i <5;i++)
//{
//string tempNo= (i+1).ToString(); //frmbotton22
////sb.Append( " <br> "+ " <a style= 'cursor:hand ' onclick=javascript:window.parent.parent.frmbotton22.ShowWindow( '../ "+ awakeTable.Rows[i][ "aimURL "]+ "?KeyID= "+ awakeTable.Rows[i][ "pkID "] + " ')> "+ tempNo+ ". "+ awakeTable.Rows[i][ "awakeTitle "] + " </a> ");
//sb.Append( " <br> "+ " <a style= 'cursor:hand ' onclick=javascript:window.parent.parent.frmbotton22.ShowWindow( 'AwakeBrowse.aspx?KeyID= "+ awakeTable.Rows[i][ "1 "] + " ')> "+ tempNo+ ". "+ awakeTable.Rows[i][ "2 "] + " </a> ");
//}
//
//sb.Append( " </div> </div> \ "; ");
[解决办法]
学习
[解决办法]
overlib
http://tag.csdn.net/tag/overlib/1.html
[解决办法]
ASP.NET Popup Control 我在引用的时候看到上面写着retail
不会是收费的吧。