导航:首页 > 编程语言 > ext50引入js

ext50引入js

发布时间:2024-08-18 21:55:27

A. js中如何弹出一个可以输入多个信息的提示对话框

思路:

如果要输入多个信息,那么原生的提示框肯定不符合要求,需要自己定义。

一般都是使用div层模拟提示框,这样就可以随便布局了。

代码示例:

1、定义CSS
<styletype="text/css">
body{
height:100%;
overflow:auto;
margin:0;
}
#test_Div{
position:fixed;
_position:absolute;
top:50%;
left:50%;
border:2pxsolid#C0C0C0;/*弹出框边框样式*/
background-color:#FFFFFF;/*弹出框背景色*/
display:none;
}
*html{
overflow:hidden;
position:absolute;
}
</style>
2、简单点,引入JQuery
<scripttype="text/javascript"src="js/jquery.min.js"></script>
<scripttype="text/javascript"src="js/jquery_ui/js/jquery-ui-1.9.2.custom.min.js"></script>
3、弹出层

functionshow_Win(div_Win,tr_Title,event){
vars_Width=document.documentElement.scrollWidth;//滚动宽度
vars_Height=document.documentElement.scrollHeight;//滚动高度
varjs_Title=$(document.getElementById(tr_Title));//标题
js_Title.css("cursor","move");
//创建遮罩层
$("<divid="div_Bg"></div>").css({"position":"absolute","left":"0px","right":"0px","width":s_Width+"px","height":s_Height+"px","background-color":"#ffffff","opacity":"0.6"}).prependTo("body");
//获取弹出层
varmsgObj=$("#"+div_Win);
msgObj.css('display','block');//必须先弹出此行,否则msgObj[0].offsetHeight为0,因为"display":"none"时,offsetHeight无法取到数据;如果弹出框为table,则为'',如果为div,则为block,否则textbox长度无法充满td
//y轴位置
varjs_Top=-parseInt(msgObj.height())/2+"px";
//x轴位置
varjs_Left=-parseInt(msgObj.width())/2+"px";
msgObj.css({"margin-left":js_Left,"margin-top":js_Top});
//使弹出层可移动
msgObj.draggable({handle:js_Title,scroll:false});
}
4、调用
<inputtype="button"value="测试弹出框"onclick="show_Win('div_Test','title',event)"/>
<divid="div_Test">
<divid="title"style="border:1pxsolidred;">标题</div>
内容
</div>
阅读全文

与ext50引入js相关的资料

热点内容
重要文件密码更换周期是多少 浏览:871
mac上用jsp写一个网页 浏览:6
word标准行间距 浏览:90
sw如何查看文件路径 浏览:329
jsp判断null 浏览:28
系统apk图标修改工具下载 浏览:703
jsp模型 浏览:431
承德货车运输哪个app好 浏览:907
华为5x书签文件夹路径 浏览:120
滑动t检验法程序 浏览:940
java百分数格式化 浏览:911
数据分析怎么看市场 浏览:993
魔兽联盟160升级攻略 浏览:234
iphone6plus直接购买 浏览:386
电脑升级后旧文件备份在哪里的 浏览:236
怎么禁止电脑文件到u盘外泄 浏览:217
pc端如何用modbustcp编程 浏览:336
富士xp142怎么编程 浏览:481
导航卡的数据是从哪里来的 浏览:168
为什么桌面会显示c盘某某文件 浏览:745

友情链接