Articles, tips and tricks, news and other little things to do better our job!

domenica, ottobre 04, 2009

Print a web page

Print a web page take often a lot of time.
The simple Print action isn't so good when your page is rich of images and style effects.

To accomplish this common problem the W3C included in the CSS declaration the MEDIA option PRINT

< link href="print.css" media="print" rel="stylesheet" type="text/css">< /link>

but this force you to write a different CSS for everypage you would print.

There is an easy way using JQuery and this Print Plugin, by Ben Nadel.
The idea is to create a new DIV with a title and the DOM object that include what you choose to print!

To see in action just include the JQuery framework, the plugin, select a DOM object and call ".print()" action after a click (or whatever you like)!

0 commenti:

Cerca nel blog

Caricamento in corso...

About This Blog

Mauro Bennici è Software Architect specializzato in .NET.

Back to TOP