Printing from an iframe in modal window in IE 7

by Andy 5/16/2008 10:13:00 AM
Printing of foupon in Iframe

I recently started loading our printable foupons into an embedded iframe which was displayed using a modal window (light box style)

Something I didn't realize when I started doing this is that IE 7's new shrink to fit printing caused the contents of my iframe to shrink down according to width of the iframe in its container.

To get around this I created a seperate style sheet containing

@media print
{

*
{
     display:none !important;
}

.fouponPopup
{
     display:block !important;
     width:100% !important;
     position:absolute !important;
     left:0px !important;
     top:0px !important;
}

.fouponPopup iframe
{
     display:block !important;
     width:100% !important;
}

}

Then in JS before showing the modal window (using AjaxControlToolKit) I add the style sheet to the header

fileref = document.createElement("link");
fileref.setAttribute(
"rel", "stylesheet");
fileref.setAttribute(
"type", "text/css");
fileref.setAttribute(
"href", website + "styles/print.css");
document.getElementsByTagName(
"head")[0].appendChild(fileref);

with fileref being a global variable.  Then when the user hits the close botton I remove the fileref object from the head.

document.getElementsByTagName("head")[0].removeChild(fileref);

I had to dynamically add/remove the css file so that users could print the pages normally in all other cases.

I am not 100% this is the best option to get around this issue in IE 7.  But it works.

Currently rated 4.0 by 1 people

  • Currently 4/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , , , , , , ,

Developement

No Such Thing as a Free lunch?

by Press 5/7/2008 11:13:00 AM
OFFICIAL PRESS RELEASE

Released May 7, 2008
Contact:
Kevin Worral
Foupons LLC
Tel: 1-716-508-4111
Fax: 1-888-333-8447
kworral@foupons.com
www.foupons.com

Foupons.com a website devoted to restaurants is turning the tables on restaurant owners, providing them with a free lunch at least that is how foupons.com sees it, as they recently began offering the majority of their online services free to restaurant owners.

Restaurants across the United States can now utilize the free exposure available on foupons.com to attract new customers, retain current ones and drive more traffic to their current websites.

Similar to other popular business listing websites such as merchantcircle.com and yelp.com; foupons.com differentiates itself by focusing solely on restaurants, providing industry specific tools such as fully searchable menus, business listings, publishing of live events, reviews, coupons and email newsletters.

Offering all of their services for free except optional coupons (foupons as they call them), they give any restaurant large or small the opportunity to get free exposure and attract customers for a price any business owner would bite on, free.

For additional information on the services offered by foupons.com visit their website at www.foupons.com.

ABOUT FOUPONS.COM –foupons.com is an online restaurant directory providing a community for restaurateurs and customers alike to share information and opinions. As well as perhaps save a little money.

-END-

©2008 Foupons LLC
www.foupons.com

Welcome to Foupons Press

Let us know what you think!

E-mail US Send mail

Calendar

<<  January 2009  >>
MoTuWeThFrSaSu
2930311234
567891011
12131415161718
19202122232425
2627282930311
2345678

View posts in large calendar

Pages

    Recent posts

    Recent comments

    • Back on Track (1)
      Frank Smith wrote: That is crazy! I love the site keep up the great … [More]

    Archive

    Disclaimer

    Any comments made are those of our readers and do not represent foupons.com view in anyway.

    © Copyright 2009

    Sign in