页面上弹出“消息提示框”的aspx
来源:互联网 发布:中国综合社会调查数据 编辑:程序博客网 时间:2024/05/10 22:27
1)window.createPopup(); 页面上浮动的窗口
2)window.screen.availWidth、window.screen.availHeight浮动窗的位置设置
3)ajax窗口内容
定义ajax的函数 如
function InitMsgBox()
{
var arg = "ControlType=QueryMsg&v=start";
<%= ClientScript.GetCallbackEventReference(this, "arg", "InitedMsgBox", null)%>;
}
其中,定义向后台传送参数的内容:var arg = "ControlType=QueryMsg&v=start";
后台处理,并将结果交给后续处理函数
对应上面例子:
后台处理语句 <%= ClientScript.GetCallbackEventReference(this, "arg", "InitedMsgBox", null)%>;
后续处理函数
function InitedMsgBox(result, context){}
4)例如:
<script type="text/javascript">
var titlePopup=window.createPopup(); //关键句
var len;
var IsShow = 1;
var pupupwidth,popupgeight;
var v;
function reDirect(v)
{
if(v==1)
{
window.open("MsgDataGridView.aspx?str=5","controlwork");
}
if(v==2)
{
window.open("MsgDataGridView.aspx?str=6","controlwork");
}
if(v==3)
{
window.open("MsgDataGridView.aspx?str=7","controlwork");
}
if(v==4)
{
window.open("MsgDataGridView.aspx?str=8","controlwork");
}
if(v==5)
{
window.open("MsgDataGridView.aspx?str=9","controlwork");
}
}
//ajax传递消息提示框里面的内容
function InitMsgBox()
{
var arg = "ControlType=QueryMsg&v=start";
<%= ClientScript.GetCallbackEventReference(this, "arg", "InitedMsgBox", null)%>;
}
function InitedMsgBox(result, context)
{
len = 0;
var titlePopupBody = titlePopup.document.body;
titlePopupBody.style.border ="solid black 1px";
var titleContent = "";
var splt = result.split('*');
if(splt.length!=2 || splt[0]<1 ) return;
else
{
titleContent=splt[1];
//alert(titleContent);
titlePopupBody.innerHTML = titleContent;
//ShowMsgBox();
window.setInterval("ShowMsg()",15);
}
}
function ShowMsg()
{
len += 4;
if (len > 180)
{
window.clearInterval(tID);
}
else
{
//300固定了消息提示框的宽度
//alert(len);
//弹出消息提示框的位置、长宽的设置
titlePopup.show(window.screen.availWidth - 300, window.screen.availHeight + 75, 300, len , top.document.body);
pupupwidth = window.screen.availWidth - 300;
popupgeight = window.screen.availHeight - len + 75;
}
}
var tID;
function ShowMsgBox()
{
tID = window.setInterval("ShowMsg()",15);
}
function HiddenMsgBox()
{
titlePopup.hide();
IsShow = 2;
}
window.setInterval("InitMsgBox()",600000)
function changeImg(v)
{
var theimg = document.getElementById(v);
//alert(theimg);
theimg.src = "images/tip5.bmp";
//alert(theimg.src);
for(var i=1;i<20;i++)
{
var imgsID = "img"+i;
if(imgsID == v) continue;
var imgs = document.getElementById("img"+i);
//alert(imgs);
if(imgs!=null)
{
imgs.src = "images/tip6.bmp";
}
}
}
</script>
<body onload="InitMsgBox();">
<form id="form1" runat="server">
<div>
<div>
<table style="width: 100%; height: 98%;">
<tr>
</tr>
</table>
</div>
</div>
</form>
</body>
</html>
<script language="javascript" type="text/javascript">
function Ctluserzone1_DrpCountry_change(v)
{
var arg = "ControlType=Ctluserzone1_DrpCountry&v="+v;
<%= ClientScript.GetCallbackEventReference(this, "arg", "Ctluserzone1_DrpCountryChanged", null)%>;
}
function Ctluserzone1_DrpCountryChanged(result, context)
{
var argResults = result.split('*');
var arg1= document.getElementById("Ctluserzone1_drpProvince");
var arg2= document.getElementById("Ctluserzone1_drpCity");
var arg3= document.getElementById("Ctluserzone1_drpCounty");
arg1.outerHTML = argResults[0];
arg2.outerHTML = argResults[1];
arg3.outerHTML = argResults[2];
}
function Ctluserzone1_drpProvince_change(v)
{
var arg = "ControlType=Ctluserzone1_drpProvince&v="+v;
<%= ClientScript.GetCallbackEventReference(this, "arg", "Ctluserzone1_drpProvinceChanged", null)%>;
}
function Ctluserzone1_drpProvinceChanged(result, context)
{
var argResults = result.split('*');
var arg2= document.getElementById("Ctluserzone1_drpCity");
var arg3= document.getElementById("Ctluserzone1_drpCounty");
arg2.outerHTML = argResults[0];
arg3.outerHTML = argResults[1];
}
function Ctluserzone1_drpCity_change(v)
{
var arg = "ControlType=Ctluserzone1_drpCity&v="+v;
<%= ClientScript.GetCallbackEventReference(this, "arg", "Ctluserzone1_drpCityChanged", null)%>;
}
function Ctluserzone1_drpCityChanged(result, context)
{
var arg3= document.getElementById("Ctluserzone1_drpCounty");
arg3.outerHTML = result;
}
</script>
- 页面上弹出“消息提示框”的aspx
- 页面上弹出“消息提示框”的cs
- 页面右下角弹出的消息提示代码
- 页面右下角弹出类似QQ或MSN的消息提示
- 页面右下角弹出类似QQ或MSN的消息提示
- 页面右下角弹出类似QQ或MSN的消息提示
- 页面右下角弹出类似QQ或MSN的消息提示
- .aspx页面弹出遮罩层
- 页面加载的时候弹出提示框
- javascript弹出消息提示框
- Sharepoint 弹出消息提示框
- aspx页面上的分页逻辑
- 右下脚弹出的提示框用来提醒用户消息
- 制作从屏幕右下角逐渐弹出的消息提示框
- PHP 弹出消息提示框的两种方法
- asp.net 页面右下角弹出类似QQ或MSN的消息提示
- asp.net 页面右下角弹出类似QQ或MSN的消息提示
- 页面右下角弹出类似QQ或MSN的消息提示(JQuery版)
- IE图标模糊怎么修复
- PHP Security for Deployers
- 编译过程中遇到的警告或错误
- 生成测试数据-2-T-SQl系列 RAND( ) 的一般用法
- mysql查询优化
- 页面上弹出“消息提示框”的aspx
- CSS语法来控制超链接的形式、颜色变化
- 编译chrome
- 获取PE文件信息的封装
- XML与DataSet的相互转换类
- POJ 1632 Vase collection
- Eclipse 配置SVN
- 使用vector::erase
- SVN 版本管理