Trigger event on dialog box open

后端 未结 4 1580
误落风尘
误落风尘 2021-02-05 06:18

My dialog box is defined under the div

#dialogbox

When the dialog box opens i want to trigger an event such that it alerts open. The code im us

4条回答
  •  难免孤独
    2021-02-05 06:48

    It will display alert after clicking on the OK button.

    $( "#WaitingDialog").html("Message you want to display").dialog({
       modal: true,
       buttons: { 
        Ok: function() {
           alert("hello");
        }
    }});
    

    It will display alert after opening the modal

    $( "#WaitingDialog").html("Message you want to display").dialog({
        modal: true,
        buttons: { 
            open: function( event, ui ) {
                  alert('hello');
              }
        }});
    

提交回复
热议问题