Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function() {
- var beforePrint = function() {
- // Change to the black theme
- };
- var afterPrint = function() {
- // Change back to the original theme
- };
- if (window.matchMedia) {
- var mediaQueryList = window.matchMedia('print');
- mediaQueryList.addListener(function(mql) {
- if (mql.matches) {
- beforePrint();
- } else {
- afterPrint();
- }
- });
- }
- window.onbeforeprint = beforePrint;
- window.onafterprint = afterPrint;
- }());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement