Difference Between .dialog(“close”) and .dialog(“destroy”)

后端 未结 3 797
醉酒成梦
醉酒成梦 2021-02-12 14:28

What is the difference between .dialog(\"close\") and .dialog(\"destroy\") in jquery-ui?

I have a script where the previous developer had used

3条回答
  •  逝去的感伤
    2021-02-12 15:13

    close leaves the dialog configured, but invisible, so you can reopen it again with .dialog('open').

    destroy will completely deconfigure the dialog box. It'll remove all of the UI elements that were added to the DOM, and any related event handlers.

    destroy will not remove the element that held the contents of the dialog box (i.e. the element that you call .dialog on)

提交回复
热议问题