Files
2013-05-20 13:37:40 +05:30

152 lines
4.5 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<link href='https://fonts.googleapis.com/css?family=Chivo:900' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="stylesheets/stylesheet.css" media="screen" />
<link rel="stylesheet" type="text/css" href="stylesheets/pygment_trac.css" media="screen" />
<link rel="stylesheet" type="text/css" href="stylesheets/print.css" media="print" />
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<title>jQuery.print by DoersGuild</title>
</head>
<body>
<div id="container">
<div class="inner">
<header>
<h1>jQuery.print</h1>
<h2>Easy to use, Element Printing Plugin for jQuery</h2>
</header>
<section id="downloads" class="clearfix">
<a href="https://github.com/DoersGuild/jQuery.print/zipball/master" id="download-zip" class="button"><span>Download .zip</span></a>
<a href="https://github.com/DoersGuild/jQuery.print/tarball/master" id="download-tar-gz" class="button"><span>Download .tar.gz</span></a>
<a href="https://github.com/DoersGuild/jQuery.print" id="view-on-github" class="button"><span>View on GitHub</span></a>
</section>
<br/>
<section class="clearfix" style="text-align: center;">
<a href="./demo" class="button"><span>Try it first</span></a>
</section>
<hr>
<section id="main_content">
<h1>jQuery Print Plugin</h1>
<p>jQuery.print is a plugin for printing specific parts of a page</p>
<h2>Usage</h2>
<p>Include it in your HTML after importing jQuery, like:
</p>
<p>Use it like:</p>
<pre><code>$("#myElementId").print(/*options*/);
</code></pre>
<p>or</p>
<pre><code>$.print("#myElementId" /*, options*/);
</code></pre>
<p>You can submit the options object like:</p>
<pre><code>$("#myElementId").print({
addGlobalStyles : true,
stylesheet : null,
rejectWindow : true,
noPrintSelector : ".no-print",
iframe : true,
append : null,
prepend : null
});
</code></pre>
<p>Currently this plugin supports the following options:</p>
<h4>globalStyles</h4>
<ul>
<li>Default: <code>true</code><br>
</li>
<li>Acceptable-Values: Boolean<br>
</li>
<li>Function: Whether or not the styles from the parent document should be included</li>
</ul><h4>mediaPrint</h4>
<ul>
<li>Default: <code>false</code><br>
</li>
<li>Acceptable-Values: Boolean<br>
</li>
<li>Function: Whether or not link tags with media='print' should be included; Over-riden by the <code>globalStyles</code> option</li>
</ul><h4>stylesheet</h4>
<ul>
<li>Default: <code>null</code>
</li>
<li>Acceptable-Values: URL-string</li>
<li>Function: URL of an external stylesheet to be included</li>
</ul><h4>noPrintSelector</h4>
<ul>
<li>Default: <code>".no-print"</code>
</li>
<li>Acceptable-Values: Any valid <code>jQuery-selector</code>
</li>
<li>Function: A selector for the items that are to be excluded from printing</li>
</ul><h4>iframe</h4>
<ul>
<li>Default: <code>true</code>, creates a hidden iframe if no-vaild iframe selector is passed</li>
<li>Acceptable-Values: Any valid <code>jQuery-selector</code> or Boolean</li>
<li>Function: Whether to print from an iframe instead of a pop-up window; can take the <code>jQuery-selector</code> of an existing iframe as value</li>
</ul><h4>append/prepend</h4>
<ul>
<li>Default: <code>null</code>
</li>
<li>Acceptable-Values: Any valid <code>jQuery-selector</code> or HTML-text</li>
<li>Function: Adds custom HTML before (prepend) or after (append) the selected content</li>
</ul><h2>Tested with</h2>
<h3>jQuery</h3>
<ul>
<li>
<a href="http://jquery.com/">jQuery</a> v. 1.7.2</li>
<li>
<a href="http://jquery.com/">jQuery</a> v. 1.9.1</li>
</ul><h3>Browsers</h3>
<ul>
<li>Google Chrome - v 20, 26</li>
<li>Internet Explorer - v 10</li>
</ul><h2>License</h2>
<p><a href="http://creativecommons.org/licenses/by/3.0/">CC-BY</a>.</p>
<h2>Demo</h2>
<p><a href="http://jsfiddle.net/5V24U/27/">jsFiddle</a></p>
<hr><p>Like our <a href="http://doersguild.com">work</a>? <a href="mailto:mail@doersguild.com">Get in touch!</a></p>
</section>
<footer>
jQuery.print is maintained by <a href="https://github.com/DoersGuild">DoersGuild</a><br>
This page was generated by <a href="http://pages.github.com">GitHub Pages</a>. Tactile theme by <a href="http://twitter.com/jasonlong">Jason Long</a>.
</footer>
</div>
</div>
</body>
</html>