开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜