1.在页面中引入:
<script type="text/javascript" src="<%=contextPath%>/js/jquery-ui.min.js"></script>
<link type="text/css" href="<%=contextPath%>/css/jquery-ui.css" rel="stylesheet" />
2.在页面中加入层
<div id="dialog-modal" title="用户基本信息查看" ></div>
3.添加一个按钮
<button id="name" οnclick="opens('<s:property value="message.user.userid" />')">查 看</button>
4.写对应的opens方法
function opens(userid){
var url="<%=contextPath%>/user/lookUser.action?usertable.userid="+userid;
$('#dialog-modal').html('<iframe width="100%" height="100%" name="dialog-modal-iframe" src="'+url+'" scrolling="no" frameborder="0" ></iframe>');
$('#dialog-modal').dialog('open');
}
5.dialog设置
$(function(){
$("#dialog-modal").dialog({
buttons: {
"关闭": function(){
//addIframeData();
$("#dialog-modal").dialog("close");
}
} ,
stackfix: true,
autoOpen: false,
width: 600,
height: 650,
position: 'middle',
modal: true //true:模态, false:非模态
});
})