Solved

Pop Up Window with Contents of Div

Posted on 2013-12-11
4
379 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 53

Accepted Solution

by:
COBOLdinosaur earned 500 total points
ID: 39712149
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
ID: 39712524
For this solution I need to have it open in a new window.
0
 
LVL 11

Author Comment

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

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article discusses how to create an extensible mechanism for linked drop downs.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …

733 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