popup java_PoPup
我點(diǎn)擊頁面上一個(gè)按鈕,從瀏覽器右下角浮起一個(gè)小框。顯示一些信息,就像一些即時(shí)通信軟件來消息以后浮起個(gè)框,顯示消息的內(nèi)容。
----------------------------------------------------------------------------------------------------------------------------
給你個(gè)js例子!稍微再改改!就可以了!
New Page 1if (document.all)
document.write('
')var sitems=new Array()
var sitemlinks=new Array()
//以下是菜單內(nèi)容,自由設(shè)置;
sitems[0]="本站首頁"
sitems[1]="最新更新"
sitems[2]="夢想軟件"
sitems[3]="其它欄目"
sitems[4]="桌面壁紙"
sitems[5]="給我留言"
sitems[6]="下載特區(qū)"
sitems[7]="Email Me"
sitems[8]="我的簡介"
//菜單項(xiàng)目連接
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(''+sitems[i]+'
')
function regenerate()
{
window.location.reload()
}
function regenerate2()
{
if (document.layers)
setTimeout("window.οnresize=regenerate",400)
}
window.οnlοad=regenerate2
if (document.all)
{
document.write('
')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
themenu.pixelLeft+=5
else if(document.layers&&themenu.left
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)
}
-----------------------------------------------------------------------------------------------------------------------------
考慮一個(gè)經(jīng)典+流行控件
ASP.NET Popup Control
http://www.codeproject.com/aspnet/asppopup.asp
-----------------------------------------------------------------------------------------------------------------------------
js
以下僅供參考
function InitMsgBox(hint)
{
len = 0;
titlePopup=window.createPopup();
var titlePopupBody = titlePopup.document.body;
titlePopupBody.style.border ="solid #ffffff 1px";
var titleContent = "";
titleContent = titleContent + "
titleContent = titleContent + "
提示信息";titleContent = titleContent + "
" + hint +"";solid #0C68CF\">";
titleContent = titleContent + "
";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);
}
-----------------------------------------------------------------------------------------------------------------------------
下面是我們的項(xiàng)目中用到的,并且實(shí)現(xiàn)的pop窗口效果
this.RegisterClientScriptBlock("popWin", this.RegisterScript(this.AwageSource()));
======================================================================================
///檢測權(quán)限
public bool CheckP(string power)
{
Hashtable ht = (Hashtable)Session[SessionName.PERMIT];
return ht.Contains(power);
}
///得到數(shù)據(jù)源
public DataTable AwageSource()
{
using (ISystemable st = (ISystemable)BNFactory.SetBN(typeof(ISystemable)))
{
int empid = int.Parse(this.Session["eppid"].ToString());
int accountId = int.Parse(this.Session[SessionName.ACCOUNT_ID].ToString());
int deptid = 0;
bool isOverLack = this.CheckP("ChaoQueYuanTiXing");
bool isBirthDay = this.CheckP("ShengRiTiXing");
return st.WakeBySystem(empid, accountId, deptid, isOverLack, isBirthDay);
}
}
///
/// 生成腳本塊的方法
/// 感謝原先的作者,非常感謝!
///
///
/// string
/// zhanglei@hrbanlv.com
private string RegisterScript(DataTable awakeTable)
{
if (stopAwakeFlag.Value == "1")
{
return "";
}
StringBuilder sb = new StringBuilder();
//增加try..catch,使ie5中因不支持window.createPopup(),而不報(bào)錯(cuò)
sb.Append("
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=\"
");=======================================================================
***** [ADDED BY DoItNow, 2005/8/27] 加入 選擇筐 控制是否 顯示提醒
-----------------------------------------------------------------------
//sb.Append("
不在提示");//=======[ADDED END]=====================================================
//int tempAwakeCount= awakeTable.Rows.Count;
//sb.Append("
您有 "+tempAwakeCount +" 條未讀提醒: [詳細(xì)] ");
//for(int i=0;i
//{
//string tempNo= (i+1).ToString(); //frmbotton22
sb.Append("
"+ ""+ tempNo+"."+ awakeTable.Rows[i]["awakeTitle"] +"");
//sb.Append("
"+ ""+ tempNo+"."+ awakeTable.Rows[i]["2"] +"");
//}
//
//sb.Append("
\";");-----------------------------------------------------------------------------------------------------------------------------
與50位技術(shù)專家面對(duì)面20年技術(shù)見證,附贈(zèng)技術(shù)全景圖總結(jié)
以上是生活随笔為你收集整理的popup java_PoPup的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: oracle和mysql查询_Oracl
- 下一篇: python 12306查询不到车次_p