简体   繁体   中英

Jquery Dialog and stacked buttons

Just wondering if anyone knows how to get the buttons to stack in a Jquery modal window? It looks like this:

$confirm.dialog({
        resizable: false,
        modal: true,
        height: 140,
        closeOnEscape: true,
        show: "blind",
        buttons: [
            {
                text: "Button 1",
                click: function() { $(this).dialog("close"); },
                class:'ok_button'
            },
            {
                text: "Button 2",
                click: function() { $(this).dialog("close"); },
                class:'ok_button'
            },
            {
                text: "Button 3",
                click: function() { $(this).dialog("close"); },
                class:'ok_button'
            }
        ],
        create: function(event, ui){
           console.log($(event.target).prev().remove());
           console.log(ui);
        }
    });

This puts the buttons side by side, any clues? Thanks for the help!

Use display: block :

.ok_button { display: block; }

http://jsfiddle.net/NMyHG/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM