jQuery UI Dialog Button Icons

后端 未结 12 1474
[愿得一人]
[愿得一人] 2020-11-29 02:40

Is it possible to add icons to the buttons on a jQuery UI Dialog? I\'ve tried doing it this way:

$(\"#DeleteDialog\").dialog({
    resizable: false,
    hei         


        
12条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-11-29 03:32

    Natively supported since jQuery UI 1.10

    Starting from jQuery UI version 1.10.0, it is possible to cleanly specify button icons without resorting to open event handlers. The syntax is:

    buttons: [
        {
            text: "OK",
            icons: { primary: "ui-icon-check" }
        },
        {
            text: "Cancel",
            icons: { primary: "ui-icon-closethick" }
        }
    ]
    

    It is also possible to specify a secondary icon.

    See it in action.

提交回复
热议问题