Solved

Pop Up Window with Contents of Div

Posted on 2013-12-11
4
366 Views
Last Modified: 2013-12-11
I'd like to know the best way to be able to click a button called print that will pop up a new window with the contents of a div on the current page to be printed.
0
Comment
Question by:N R
  • 2
4 Comments
 
LVL 53

Accepted Solution

by:
COBOLdinosaur earned 500 total points
Comment Utility
You don't really need a new window.  Just use an @media print in the stylesheet

@media print
  {
     style rules here
  }

Then set everything you don't want to print to display:none, and apply any special style you need to the div for optimum printing.

for the button you just need onclick="window.print();"

Cd&
0
 
LVL 11

Author Comment

by:N R
Comment Utility
For this solution I need to have it open in a new window.
0
 
LVL 11

Author Comment

by:N R
Comment Utility
Nevermind, I see what you mean now, it opens it into a print view anyways almost like a popup window.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
In this tutorial viewers will learn how add a full-size background image to a webpage using CSS3. Create a new HTML document with an internal stylesheet.: In CSS, define the html element to have a background image. Use a high resolution image.: In t…
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now