0

代码:

在 Jquery 对话框中,

$('#status-dialog')
                .dialog({
                    hide: 'fade',
                    autoOpen: false,
                    resizable: true,
                    title: 'Status',
                    modal: false
                });

索引.cshtml

<div class ="cb-status">
    <input id="accept-cb-name" type="checkbox"/>
    By Name<br /><br />
</div>

如何在 jquery 对话框标题(“状态”)栏上显示复选框?

4

1 回答 1

1

在这里查看演示http://jsfiddle.net/yeyene/GnpQ8/7/

$(document).ready(function(){
    $("#dialog-model").dialog({
        create: function (event, ui) {
            $(".ui-dialog-title").html('<input id="accept-cb-name" type="checkbox"/> By Name');
        },
        width: 250,
        height: 150,       
        modal: true,
        resizable: false
    });
    // checkbox event
    $(document).on('click','.ui-dialog-title input', function(){
        alert('Bang !!');
    });
}); 
于 2013-07-05T05:58:17.487 回答