javascript - Elements with display: none are printing to sheet. -


im having trouble getting work have complex html page has chart(from highcharts) when try print chart, prints chart plus page has elements set display: none. module highcharts.

print: function () {     // win.print();     var chart = this,         container = chart.container,         origdisplay = [],         origparent = container.parentnode,         body = doc.body,         childnodes = body.childnodes;      if (chart.isprinting) { // block button while in printing mode         return;     }      chart.isprinting = true;      // hide body content     each(childnodes, function (node, i) {         if (node.nodetype === 1) {             origdisplay[i] = node.style.display;             node.style.display = 'none';         }     });      // pull out chart     body.appendchild(container);      // print     win.focus(); // #1510     win.print();        // allow browser prepare before reverting     settimeout(function () {          // put chart in         origparent.appendchild(container);          // restore body content         each(childnodes, function (node, i) {             if (node.nodetype === 1) {                 node.style.display = origdisplay[i];             }         });          chart.isprinting = false;      }, 1000); }, 

i don't know why not working. here link page source code.

thanks!


Comments

Popular posts from this blog

php - cannot display multiple markers in google maps v3 from traceroute result -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -