【问题标题】:Kendo UI Window Relative to Button Position相对于按钮位置的 Kendo UI 窗口
【发布时间】:2014-04-01 18:26:03
【问题描述】:

我正在尝试将 Kendo UI 模式窗口放在我的按钮旁边,但它不起作用。

这是我的按钮点击代码:

$('#button').click(function() {
    var x = $("#button").offset().left;
    var y = $("#button").offset().top;

    window1 = $('#window1');
    if (!window1.data("kendoWindow")) {
        window1.kendoWindow({
            actions: ["Refresh", "Close"],
            width: "450px",
            position: {
                left: x,
                top: y
            },
            title: "Window Title",
            modal: true,
            resizable: false
        });
    }
    window1.show();
    window1.data("kendoWindow").open();
});

【问题讨论】:

    标签: kendo-ui kendo-window


    【解决方案1】:

    一切就绪。

        $("#window1").closest(".k-window").css({
            top: y,
            left: x
        });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-07-10
      • 1970-01-01
      • 1970-01-01
      • 2011-01-27
      • 2017-09-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多