Jquery.print插件隐藏href链接

时间:2016-10-10 09:14:38

标签: jquery printing

我们正在使用jquery.print插件here,但是它会打印href标签中的链接 - 任何人都知道如何隐藏链接但仍然在链接中打印文本? TQ

$("#contentinner").print({
        globalStyles: true,
        mediaPrint: false,
        stylesheet: null,
        noPrintSelector: ".no-print",
        iframe: true,
        append: null,
        prepend: null,
        manuallyCopyFormValues: true,
        deferred: $.Deferred(),
        timeout: 750,
        title: null,
        doctype: '<!doctype html>'
});

编辑 - 添加到全局css之后,它隐藏了链接,但也隐藏了内部文本

 @media print {
  a[href] { display: none; }
 }

编辑 - 这有效,谢谢你Sathvik @ DoersGuild

@media print {
   a[href]:after {
     content: none !important;
   }
}

1 个答案:

答案 0 :(得分:1)

您可以使用@media查询来设置链接的样式,使其在打印版本中看起来像普通文字:

@media print {
    // your styles
}