开发者

How to display a print icon in a dialog box button using jquery?

开发者 https://www.devze.com 2023-03-03 06:43 出处:网络
How to display a print icon in a dialog box button using jquery? $( \"#dialog-message\" ).dialog({ modal: true,

How to display a print icon in a dialog box button using jquery?

$( "#dialog-message" ).dialog({
        modal: true,
        buttons: {
            Ok: function() {
           开发者_C百科     $( this ).dialog( "close" );
            }
        }
    });


Perhaps you're looking for something like the Modal Message demo, though with a Print icon of some sort rather than a checkmark.


From jQuery UI Dialog Button Icons:

$( "#dialog-message" ).dialog({
    modal: true,
    buttons: {
        Ok: function() {
            $( this ).dialog( "close" );
        }
    },
    open: function() {
        $('.ui-dialog-buttonpane').find('button:contains("Ok")').button({
            icons: {
                // here's a hint: you don't want a "cancel" icon
                primary: 'ui-icon-cancel'
            }
        });
    }
});

Demo: http://jsbin.com/avixe4


In case my hint wasn't obvious enough, you just need to change 'ui-icon-cancel' to 'ui-icon-print' in the code above.

Demo #2: http://jsbin.com/avixe4/2

0

精彩评论

暂无评论...
验证码 换一张
取 消