Code
<script language="javascript">
<!--
window.onload = getMsg;
window.onresize = resizediv;
window.onerror = function(){}
//短信提示使用(FHB添加)
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>300) 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: 700px; visibility: hidden; border-left: #a6b4cf 1px solid;
width: 249px; border-bottom: #455690 1px solid; position: absolute; top: 500px;
height: 151px; background-color: #cee1c4">
<table width="100%" height="151" border="0" cellpadding="0" cellspacing="1" bgcolor="green"
style="border-top: #ffffff 1px solid; border-left: #ffffff 1px solid">
<tbody>
<tr bgcolor="#6699cc">
<td width="1" height="24" bgcolor="#6699cc" style="font-size: 12px; color: #0f2c8c">
</td>
<td width="206" valign="middle" bgcolor="green" style="padding-left: 4px; font-weight: normal;
font-size: 12px; color: #ffffff; padding-top: 2px">
<%-- <a href="Customer_View/Custmoer_cus_away.aspx">
<asp:Label ID="lblBirthday" runat="server"></asp:Label></a> <a href="Customer_View/Custmoer_cus_away.aspx">
有<asp:Label ID="lblBargain" runat="server"></asp:Label>个合同今天到收款日期</a>--%>
友情提示
</td>
<td width="39" align="right" valign="middle" bgcolor="green" style="padding-right: 2px;
padding-left: 3px; padding-top: 2px; font-size: 12px">
<span title="关闭" style="font-size: 12px; cursor: hand; color: white; margin-right: 2px"
onclick="closediv()">关闭</span>
</td>
</tr>
<tr>
<td height="90" colspan="3" align="center" bgcolor="#afe195" style="padding-right: 5px;
padding-left: 5px; padding-bottom: 3px; padding-top: 3px; font-size: 12px;">
ggggggggggggggggggggggggg
<a href="BirthdayInfo.aspx"><asp:Label ID="lblBirthday" Text="中华人民共和国" runat="server"></asp:Label></a>
<a href="Bargain.aspx"> <asp:Label ID="lblBargain" Text="sss" runat="server"></asp:Label></a>
</td>
</tr>
</tbody>
</table>
</div>
<html>
<body>
ddddddddddddddddddddddddd
</body>
</html>
<script language="javascript">
<!--
window.onload = getMsg;
window.onresize = resizediv;
window.onerror = function(){}
//短信提示使用(FHB添加)
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>300) 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: 700px; visibility: hidden; border-left: #a6b4cf 1px solid;
width: 249px; border-bottom: #455690 1px solid; position: absolute; top: 500px;
height: 151px; background-color: #cee1c4">
<table width="100%" height="151" border="0" cellpadding="0" cellspacing="1" bgcolor="green"
style="border-top: #ffffff 1px solid; border-left: #ffffff 1px solid">
<tbody>
<tr bgcolor="#6699cc">
<td width="1" height="24" bgcolor="#6699cc" style="font-size: 12px; color: #0f2c8c">
</td>
<td width="206" valign="middle" bgcolor="green" style="padding-left: 4px; font-weight: normal;
font-size: 12px; color: #ffffff; padding-top: 2px">
<%-- <a href="Customer_View/Custmoer_cus_away.aspx">
<asp:Label ID="lblBirthday" runat="server"></asp:Label></a> <a href="Customer_View/Custmoer_cus_away.aspx">
有<asp:Label ID="lblBargain" runat="server"></asp:Label>个合同今天到收款日期</a>--%>
友情提示
</td>
<td width="39" align="right" valign="middle" bgcolor="green" style="padding-right: 2px;
padding-left: 3px; padding-top: 2px; font-size: 12px">
<span title="关闭" style="font-size: 12px; cursor: hand; color: white; margin-right: 2px"
onclick="closediv()">关闭</span>
</td>
</tr>
<tr>
<td height="90" colspan="3" align="center" bgcolor="#afe195" style="padding-right: 5px;
padding-left: 5px; padding-bottom: 3px; padding-top: 3px; font-size: 12px;">
ggggggggggggggggggggggggg
<a href="BirthdayInfo.aspx"><asp:Label ID="lblBirthday" Text="中华人民共和国" runat="server"></asp:Label></a>
<a href="Bargain.aspx"> <asp:Label ID="lblBargain" Text="sss" runat="server"></asp:Label></a>
</td>
</tr>
</tbody>
</table>
</div>
<html>
<body>
ddddddddddddddddddddddddd
</body>
</html>
Code
<SCRIPT>
var oPopup = window.createPopup();
var popTop=50;
function popmsg(msgstr){
var winstr="<table style=\"border: 1 solid #FFA6CA\" width=\"241\" height=\"172\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" background=\"http://www.blueidea.com/articleimg/2004/01/1576/04-s.jpg\" >";
winstr+="<tr><td height=\"30\"> </td></tr><tr><td align=\"center\"><table width=\"90%\" height=\"110\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
winstr+="<tr><td valign=\"top\" style=\"font-size:12px; color: red; face: Tahoma\">"+msgstr+"</td></tr></table></td></tr></table>";
oPopup.document.body.innerHTML = winstr;
popshow();
}
function popshow(){
window.status=popTop;
if(popTop>1720){
clearTimeout(mytime);
oPopup.hide();
return;
}else if(popTop>1520&&popTop<1720){
oPopup.show(screen.width-250,screen.height,241,1720-popTop);
}else if(popTop>1500&&popTop<1520){
oPopup.show(screen.width-250,screen.height+(popTop-1720),241,172);
}else if(popTop<180){
oPopup.show(screen.width-250,screen.height,241,popTop);
}else if(popTop<220){
oPopup.show(screen.width-250,screen.height-popTop,241,172);
}
popTop+=10;
var mytime=setTimeout("popshow();",50);
}
popmsg(" <img border=\"0\" src=\"http://www.blueidea.com/img/common/logo.gif\" width=\"90\" height=\"27\">欢迎光临。");
</SCRIPT>
<SCRIPT>
var oPopup = window.createPopup();
var popTop=50;
function popmsg(msgstr){
var winstr="<table style=\"border: 1 solid #FFA6CA\" width=\"241\" height=\"172\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" background=\"http://www.blueidea.com/articleimg/2004/01/1576/04-s.jpg\" >";
winstr+="<tr><td height=\"30\"> </td></tr><tr><td align=\"center\"><table width=\"90%\" height=\"110\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
winstr+="<tr><td valign=\"top\" style=\"font-size:12px; color: red; face: Tahoma\">"+msgstr+"</td></tr></table></td></tr></table>";
oPopup.document.body.innerHTML = winstr;
popshow();
}
function popshow(){
window.status=popTop;
if(popTop>1720){
clearTimeout(mytime);
oPopup.hide();
return;
}else if(popTop>1520&&popTop<1720){
oPopup.show(screen.width-250,screen.height,241,1720-popTop);
}else if(popTop>1500&&popTop<1520){
oPopup.show(screen.width-250,screen.height+(popTop-1720),241,172);
}else if(popTop<180){
oPopup.show(screen.width-250,screen.height,241,popTop);
}else if(popTop<220){
oPopup.show(screen.width-250,screen.height-popTop,241,172);
}
popTop+=10;
var mytime=setTimeout("popshow();",50);
}
popmsg(" <img border=\"0\" src=\"http://www.blueidea.com/img/common/logo.gif\" width=\"90\" height=\"27\">欢迎光临。");
</SCRIPT>
Code
<input type="button" value="点击这里" onclick="sAlert('测试效果<br>这原来还可以写HTML代码哟 <br> hucn');" />fdsfdsfdsfdsfdsf
<script type="text/javascript" language="javascript">
function sAlert(str){
var msgw,msgh,bordercolor;
msgw=400;//提示窗口的宽度
msgh=100;//提示窗口的高度
bordercolor="#336699";//提示窗口的边框颜色
titlecolor="#99CCFF";//提示窗口的标题颜色
var sWidth,sHeight;
sWidth=document.body.offsetWidth;
sHeight=document.body.offsetHeight;
var bgObj=document.createElement("div");
bgObj.setAttribute('id','bgDiv');
bgObj.style.position="absolute";
bgObj.style.top="0";
bgObj.style.background="#777";
bgObj.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=3,opacity=25,finishOpacity=75";
bgObj.style.opacity="0.6";
bgObj.style.left="0";
bgObj.style.width=sWidth + "px";
bgObj.style.height=sHeight + "px";
document.body.appendChild(bgObj);
var msgObj=document.createElement("div")
msgObj.setAttribute("id","msgDiv");
msgObj.setAttribute("align","center");
msgObj.style.position="absolute";
msgObj.style.background="white";
msgObj.style.font="12px/1.6em Verdana, Geneva, Arial, Helvetica, sans-serif";
msgObj.style.border="1px solid " + bordercolor;
msgObj.style.width=msgw + "px";
msgObj.style.height=msgh + "px";
msgObj.style.top=(document.documentElement.scrollTop + (sHeight-msgh)/2) + "px";
msgObj.style.left=(sWidth-msgw)/2 + "px";
var title=document.createElement("h4");
title.setAttribute("id","msgTitle");
title.setAttribute("align","right");
title.style.margin="0";
title.style.padding="3px";
title.style.background=bordercolor;
title.style.filter="progid:DXImageTransform.Microsoft.Alpha(startX=20, startY=20, finishX=100, finishY=100,style=1,opacity=75,finishOpacity=100);";
title.style.opacity="0.75";
title.style.border="1px solid " + bordercolor;
title.style.height="18px";
title.style.font="12px Verdana, Geneva, Arial, Helvetica, sans-serif";
title.style.color="white";
title.style.cursor="pointer";
title.innerHTML="关闭";
title.onclick=function(){
document.body.removeChild(bgObj);
document.getElementById("msgDiv").removeChild(title);
document.body.removeChild(msgObj);
}
document.body.appendChild(msgObj);
document.getElementById("msgDiv").appendChild(title);
var txt=document.createElement("p");
txt.style.margin="1em 0"
txt.setAttribute("id","msgTxt");
txt.innerHTML=str;
document.getElementById("msgDiv").appendChild(txt);
}
</script>
<input type="button" value="点击这里" onclick="sAlert('测试效果<br>这原来还可以写HTML代码哟 <br> hucn');" />fdsfdsfdsfdsfdsf
<script type="text/javascript" language="javascript">
function sAlert(str){
var msgw,msgh,bordercolor;
msgw=400;//提示窗口的宽度
msgh=100;//提示窗口的高度
bordercolor="#336699";//提示窗口的边框颜色
titlecolor="#99CCFF";//提示窗口的标题颜色
var sWidth,sHeight;
sWidth=document.body.offsetWidth;
sHeight=document.body.offsetHeight;
var bgObj=document.createElement("div");
bgObj.setAttribute('id','bgDiv');
bgObj.style.position="absolute";
bgObj.style.top="0";
bgObj.style.background="#777";
bgObj.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=3,opacity=25,finishOpacity=75";
bgObj.style.opacity="0.6";
bgObj.style.left="0";
bgObj.style.width=sWidth + "px";
bgObj.style.height=sHeight + "px";
document.body.appendChild(bgObj);
var msgObj=document.createElement("div")
msgObj.setAttribute("id","msgDiv");
msgObj.setAttribute("align","center");
msgObj.style.position="absolute";
msgObj.style.background="white";
msgObj.style.font="12px/1.6em Verdana, Geneva, Arial, Helvetica, sans-serif";
msgObj.style.border="1px solid " + bordercolor;
msgObj.style.width=msgw + "px";
msgObj.style.height=msgh + "px";
msgObj.style.top=(document.documentElement.scrollTop + (sHeight-msgh)/2) + "px";
msgObj.style.left=(sWidth-msgw)/2 + "px";
var title=document.createElement("h4");
title.setAttribute("id","msgTitle");
title.setAttribute("align","right");
title.style.margin="0";
title.style.padding="3px";
title.style.background=bordercolor;
title.style.filter="progid:DXImageTransform.Microsoft.Alpha(startX=20, startY=20, finishX=100, finishY=100,style=1,opacity=75,finishOpacity=100);";
title.style.opacity="0.75";
title.style.border="1px solid " + bordercolor;
title.style.height="18px";
title.style.font="12px Verdana, Geneva, Arial, Helvetica, sans-serif";
title.style.color="white";
title.style.cursor="pointer";
title.innerHTML="关闭";
title.onclick=function(){
document.body.removeChild(bgObj);
document.getElementById("msgDiv").removeChild(title);
document.body.removeChild(msgObj);
}
document.body.appendChild(msgObj);
document.getElementById("msgDiv").appendChild(title);
var txt=document.createElement("p");
txt.style.margin="1em 0"
txt.setAttribute("id","msgTxt");
txt.innerHTML=str;
document.getElementById("msgDiv").appendChild(txt);
}
</script>