導航:首頁 > 編程語言 > 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相關的資料

熱點內容
專題學習網站源碼 瀏覽:163
jsphead什麼 瀏覽:88
gps串口數據怎麼發送 瀏覽:968
win10文件主頁共享查看 瀏覽:411
中國聯通有哪些app是免流的 瀏覽:176
邊做邊保存的文件找不到了 瀏覽:858
win10照片應用文件夾名稱 瀏覽:966
編程如何解決資金的原子性 瀏覽:638
如何製作廣角鏡頭矯正文件 瀏覽:513
在網頁開發中應該選用哪個資料庫 瀏覽:742
iphone5移動卡貼 瀏覽:990
電腦文件的格式 瀏覽:127
extjs的xtype 瀏覽:959
suse11iso文件要u盤安裝 瀏覽:153
如何將報表統計數據轉化為圖形 瀏覽:444
如何寄快遞材料文件 瀏覽:265
java構造方法private 瀏覽:475
手機文件找回恢復 瀏覽:516
word怎麼把u盤里的文件拔掉 瀏覽:976
港版蘋果用的插排 瀏覽:1000

友情鏈接