Created
June 6, 2017 02:09
-
-
Save qwersk/30bf4629375579d0ee7fc37a5c9cbcb5 to your computer and use it in GitHub Desktop.
AFTER CLOSE PRINT WINDOW #JS #JAVASCRIPT
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function close_print(){ | |
var beforePrint = function() { | |
console.log('Functionality to run before printing.'); | |
}; | |
var afterPrint = function() { | |
//console.log('Functionality to run after printing'); | |
$("#animal_menu, .single-subnav, #footer-credits-wrap, #mainpage-header, #print_button, .legend").show(); | |
$(".park_map_page").css("width", 1170); | |
}; | |
if (window.matchMedia) { | |
var mediaQueryList = window.matchMedia('print'); | |
mediaQueryList.addListener(function(mql) { | |
if (mql.matches) { | |
beforePrint(); | |
} else { | |
afterPrint(); | |
} | |
}); | |
} | |
window.onbeforeprint = beforePrint; | |
window.onafterprint = afterPrint; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment