【问题标题】:Print option for the contents of a jqueryui dialog popup? is this possible?jqueryui对话框弹出内容的打印选项?这可能吗?
【发布时间】:2011-05-26 00:21:32
【问题描述】:

当有人点击一个按钮时,它会打开一个 jquery-ui 弹出窗口(对话框)。

我需要在此弹出窗口上添加“打印”按钮,以便有人可以打印出弹出对话框的内容。

这可能吗?我该怎么做?

【问题讨论】:

    标签: jquery jquery-ui


    【解决方案1】:

    为此有一些插件,like jqPrint (demo here),您只需添加一个调用该功能的打印按钮,例如:

    $("#dialog").dialog({
      buttons: { 
        "Print": function() { $("#dialog").jqprint(); },
        "Close": function() { $(this).dialog("close"); }
      }
    });
    

    【讨论】:

    • 演示似乎无处可去
    • 我改用了这个printArea plugin。一旦我将对话框设置为modal=false,效果很好。
    猜你喜欢
    • 1970-01-01
    • 2012-12-24
    • 1970-01-01
    • 1970-01-01
    • 2011-12-02
    • 1970-01-01
    • 1970-01-01
    • 2014-08-18
    • 2011-12-29
    相关资源
    最近更新 更多