I have a print button that launches the print functionality on any webpage. The button hides as soon as the user clicks on it and shows if the user is done printing or presses close in the print window. It works fine in Chrome but is failing in firefox and IE.
<input type="button" onclick="launchPrint()" value= "Print me" />
function launchPrint(){
$(".print-box").hide();
window.print();
}
(function() {
if (window.matchMedia) {
var mediaQueryList = window.matchMedia('print');
mediaQueryList.addListener(function(mql) {
if (!mql.matches) {
$(".print-box").show();
}
});
}
}());
Any suggestions what I may be missing?