javascript - Window.Print() Div with Overflow-x? -
i want print div has has overflow-x:auto;
property (it wraps several page widths).
in chrome, page scaled , displays correct. however, in ie (8-10), cuts off div part that's visible on screen.
below function:
function print() { var printcontent = document.getelementbyid("<%=printable.clientid%>"); var windowurl = 'about:blank'; var uniquename = new date(); var windowname = 'print' + uniquename.gettime(); var printwindow = window.open(windowurl, windowname, 'left=5000,top=5000,width=0,height=0'); printwindow.document.write("<html> "); printwindow.document.write("<head> "); printwindow.document.write("<link type=text/css rel=stylesheet href='/ebusinessstylesnew.css' /> "); printwindow.document.write("</head> "); printwindow.document.write("<body topmargin=0 leftmargin=0 bgcolor='#ffffff'> "); printwindow.document.write(printcontent.innerhtml); printwindow.document.write("</body> "); printwindow.document.write("</html> "); printwindow.document.close(); printwindow.focus(); printwindow.print(); printwindow.close(); return false; }
is there can add function correctly print div?
try (after <link...>
):
printwindow.document.write('<style media="print">a_selector_for_the_div{overflow-x:visible;}</style>');
Comments
Post a Comment