Sometime you need change html when print
Apply for chrome.
if (window.matchMedia) {
var mediaQueryList = window.matchMedia('print');
mediaQueryList.addListener(function(mql) {
if (mql.matches) {
$("#flotcontainer").css('width', '270px');
$.plot($("#flotcontainer"), data, options);
$("#flotcontainer").UseClick();
}
});
}
Apply for firefox
window.onbeforeprint = function() {
$("#flotcontainer").css('width', '170px');
$.plot($("#flotcontainer"), data, options);
$("#flotcontainer").UseClick();
};
window.onafterprint = function() {
$("#flotcontainer").css('width', '100%');
$.plot($("#flotcontainer"), data, options);
$("#flotcontainer").UseClick();
};
No comments:
Post a Comment