8.7w+
社区成员
window.parent.art.dialog.open(test.html, {
id : "dialog1",
title: '写邮件',
width: 800,
height: 500,
resize: false,
lock: true, // 是否锁屏
background: '#000', // 遮罩颜色
opacity: .5, // 遮罩透明度
duration: 100, // 遮罩透明度渐变动画速度
//close: function() {
// console.log("ok");
// window.parent.art.dialog.confirm("test", function() {
// console.log('ok');
// })
//}
cancel: function () {
if(window.parent.art.dialog.confirm('Are you sure')){
window.parent.art.dialog.alert("ok");
} else {
window.parent.art.dialog.alert("not ok");
}
window.parent.art.dialog.alert('你点了取消按钮')
}
}, false);
cancel: function () {
if(confirm('Are you sure')){
alert(1);
} else {
alert(2);
}
//alert('你点了取消按钮')
}
完整的例子在这,github上的这个页面:aui-artDialog-9fd667e/test/show.html
<!doctype html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<title>test</title>
</head>
<body>
<button data-event="test">open dialog</button>
<script src="../lib/sea.js"></script>
<script>
seajs.config({
alias: {
"jquery": "jquery-1.10.2.js"
}
});
</script>
<script>
seajs.use(['jquery', '../src/dialog'], function ($, dialog) {
$('button[data-event=test]').on('click', function () {
var d = dialog({
title: '消息',
content: '风吹起的青色衣衫,夕阳里的温暖容颜,你比以前更加美丽,像盛开的花<br>——许巍《难忘的一天》',
okValue: '确 定',
ok: function () {
var that = this;
setTimeout(function () {
that.title('提交中..');
}, 2000);
return false;
},
cancelValue: '取消',
cancel: function () {
if(confirm('Are you sure')){
alert(1);
} else {
alert(2);
}
//alert('你点了取消按钮')
}
});
d.show();
});
});
</script>
</body>
</html>