Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Got it! I found an idea here</p> <p><a href="http://www.mail-archive.com/discuss@jquery.com/msg18410.html" rel="noreferrer">http://www.mail-archive.com/discuss@jquery.com/msg18410.html</a></p> <p>In this example, they loaded a blank popup window into an object, cloned the contents of the element to be displayed, and appended it to the body of the object. Since I already knew what the contents of view-details (or any page I load in the lightbox), I just had to clone that content instead and load it into an object. Then, I just needed to print that object. The final outcome looks like this:</p> <pre><code>$('.printBtn').bind('click',function() { var thePopup = window.open( '', "Customer Listing", "menubar=0,location=0,height=700,width=700" ); $('#popup-content').clone().appendTo( thePopup.document.body ); thePopup.print(); }); </code></pre> <p>I had one small drawback in that the style sheet I was using in view-details.php was using a relative link. I had to change it to an absolute link. The reason being that the window didn't have a URL associated with it, so it had no relative position to draw on.</p> <p>Works in Firefox. I need to test it in some other major browsers too.</p> <p>I don't know how well this solution works when you're dealing with images, videos, or other process intensive solutions. Although, it works pretty well in my case, since I'm just loading tables and text values.</p> <p>Thanks for the input! You gave me some ideas of how to get around this.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload