【问题标题】:Jquery Dialog and stacked buttonsJquery 对话框和堆叠按钮
【发布时间】:2012-01-01 12:48:31
【问题描述】:

只是想知道是否有人知道如何让按钮在 Jquery 模式窗口中堆叠?它看起来像这样:

$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);
        }
    });

这将按钮并排放置,有什么线索吗?感谢您的帮助!

【问题讨论】:

  • 添加css类.ok_button {clear:both;}
  • 对不起,这没有成功
  • 你有什么问题?你喜欢如何设置按钮的样式?
  • 试试这篇文章,它告诉你如何设置按钮stackoverflow.com/questions/1138291/…
  • 我在问如何将按钮堆叠在一起而不是并排。并排是 Jquery 的默认设置。

标签: javascript jquery html css


【解决方案1】:

使用display: block:

.ok_button { display: block; }

http://jsfiddle.net/NMyHG/

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-08-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多