Ich versuche herauszufinden, warum die @media print
scheint nicht auf dem iOS zu arbeiten, auf Android funktioniert die Funktionalität gut. Im Grunde habe ich eine Funktionalität gemacht, den Inhalt zu verbergen, die nicht Teil des Drucks sindPrint Media Abfrage funktioniert nicht auf iOS (Chrome, Safari, Mozilla)
body.printing *{display : none}
und nur die Inhalte anzuzeigen, die
body.printing .print-me, body.printing .print-me > div{display : block}
gedruckt werden.
$('.print-modal').on('click', function() {
$('body').addClass('printing');
window.print();
$("body").removeClass("printing");
})
@media print {
/* Hide everything in the body when printing... */
body.printing * { display: none; }
/* ...except our special div. */
body.printing .print-me, body.printing .print-me > div { display: block; }
}
@media screen {
/* Hide the special layer from the screen. */
.print-me { display: none; }
}
Was wird in 'iOS' gedruckt? – sabithpocker
@sabitpocker die ganze Seite – clestcruz
Setzen Sie nicht einmal die 'printing' Klasse ein - das ist der ganze Sinn des' @media print' –