【发布时间】:2016-10-10 09:14:37
【问题描述】:
我们正在使用 jquery.print 插件here,但是它会打印在 href 标记中找到的链接 - 任何人都知道如何隐藏链接但仍然打印链接中的文本?周全
$("#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;
}
}
【问题讨论】: