jquery弹出对话框
使用jquery ui弹出对话框,需引用jquery库及jquery ui库,可从官网下载
<div id="dialog" title="" style="display:none;">
<Br>
<textarea id="context" rows="5" cloumn="10"></textarea>
</div>
$("#dialog").dialog({
resizable : false,
position : [ x, y ],//弹出对话框位置,相对于弹出页面的位置
autoOpen : false,//是否自动打开,默认为true
width:400,//设定对话框宽度
//给弹出对话框增加2个按钮
buttons : [ {
text : "确定",
click : function() {
//编写要处理的内容
//.................
$(this).dialog("close");
}
}, {
text : "取消",
click : function() {
$(this).dialog("close");
}
} ]
});
// 对话框打开时要处理的内容,如将文本框中的内容清除等等
$( "#dialog" ).on( "dialogopen", function( event, ui ) {
$('#context').attr('value','');
});