关于弹出一个层(c# js)

来源:百度知道 编辑:UC知道 时间:2024/05/11 13:12:52
因为微软的那个弹出窗口好像必须要用Linkbutton来做

我现在是一个文本框Textbox(id="tb1")

我想用onclick实现点击这个文本框就是当前页面弹出一个层div(id="d1")

需要这个层在页面 居中

var newDIV=document.createElement("div");
//设置样式 第一种方法
newDIV.style.textAlign="center";
newDIV.style.width=300px;
newDIV.style.height=200px;
newDIV.style.backgroundColor=white;

newDiv.innerHTML="你要输出的信息";
//加载到页面上显示。
document.body.appendChild(newDIV);

补充:
也可以使用css来定义新建DIV的样式
newDIV.className="newDiv";
<style type="text/css">
.newDIV{width:300px;height:200px;background-color:white;}
</style>

再附上一个别人写好的js包,调用函数就可以了。

//等待操作
function WaitingOpe( msg )
{

IEWaitingOpe( msg );

}

//处理失败
function FailDiv( strTitle, strMsg, flag)
{

IEFailDiv( strTitle, strMsg,flag );

}

//成功提示
function SuccessDiv( strTitle, strMsg )
{

IESuccessDiv( strTitle, strMsg );

}

/**************************************