Dojo dijit.Dialog动画

时间:2011-08-23 14:22:00

标签: animation dojo dialog

如何让dijit.Dialog在给定时间内淡出?有没有办法定义它?

我在方法中创建了上面的对话框。但我需要经常调用该方法。因此它将创建多个对话框。那么在可见对话框消失之前如何阻止(不显示)其他对话框?

1 个答案:

答案 0 :(得分:1)

<script>
    // Require the Dialog class
    dojo.require("dijit.Dialog");
    // Create counter
    var counter = 1;
    // Create a new Dialog
    function createDialog(first) {
        // Create a new dialog
        var dialog = new dijit.Dialog({
            // Dialog title
            title: "New Dialog " + counter,
            // Create Dialog content
            content: (!first ? "I am a dialog on top of other dialogs" : "I am the bottom dialog") + "<br /><br /><button onclick='createDialog();'>Create another dialog.</button>"
        });
        dialog.show();
        counter++;
    } </script> <button onclick="createDialog(true);">Create New Dialog</button>