<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<!--引入基本库-->
<script type="text/javascript" src="jquery-easyui-1.5.5.4/jquery.min.js"></script>
<script type="text/javascript" src="jquery-easyui-1.5.5.4/jquery.easyui.min.js"></script>
<script type="text/javascript" src="jquery-easyui-1.5.5.4/locale/easyui-lang-zh_CN.js"></script>
<link rel="stylesheet" href="jquery-easyui-1.5.5.4/themes/default/easyui.css" />
<link rel="stylesheet" href="jquery-easyui-1.5.5.4/themes/icon.css" />
</head>
<body>
<!--
头工具栏:add+save
脚工具栏:ok+cancel
初始打开:closed:false
远程引用
-->
<div class="easyui-dialog" style="width: 400px;height: 300px;" title="方式一" data-options="toolbar:[{
iconCls:'icon-add',
text:'Add',
handler:function(){
alert('add')
}
},'-',{
iconCls:'icon-save',
text:'Save',
handler:function(){
alert('save')
}
}],buttons:[{
iconCls:'icon-ok',
text:'OK',
handler:function(){
alert('OK')
}
},{
iconCls:'icon-cancel',
text:'Cancel',
handler:function(){
alert('Cancel')
}
}],closed:false">
</div>
<div class="easyui-dialog" style="width: 800px;height: 600px;" title="方式二" data-options="toolbar:'#tool',buttons:'#btn'">
</div>
<div id="tool">
<a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true" onclick="javascript:alert('add')">Add</a>
<a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-save',plain:true" onclick="javascript:alert('save')">Save</a>
</div>
<div id="btn">
<a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-ok',plain:true" onclick="javascript:alert('add')">OK</a>
<a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-cancel',plain:true" onclick="javascript:alert('cancel')">Cancel</a>
</div>
<div id="js-dialog" style="width: 1200px;height: 900px;">
</div>
<script type="text/javascript">
$("#js-dialog").dialog({
title: '方式三',
toolbar: [{
iconCls: 'icon-add',
text: 'Add',
handler: function() {
alert('add')
}
}, '-', {
iconCls: 'icon-save',
text: 'Save',
handler: function() {
alert('save')
}
}],
buttons: [{
iconCls: 'icon-ok',
text: 'OK',
handler: function() {
alert('OK')
}
}, {
iconCls: 'icon-cancel',
text: 'Cancel',
handler: function() {
alert('Cancel')
}
}],
href: 'tree.html'
})
</script>
</body>
</html>