For example, please compare that print the page using the print button using javascript: print without print with CSS media queries that use the print button onclick print content .
Screenshot print pages with javascript button.
Screenshot pages print with onclick button.
DEMO
Please try and compare the two buttons below the post printnya demo page .
If you are interested to try it out, please copy the code below. Please save the code below to make printnya button below the post
<div onclick='printContent('printarea')' style='margin:20px 0;cursor:pointer'><img alt='print' height='16' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgelXuGSPG786AeIVMKYwpi1Fx1MoZFR98JVxSVAtbslFp6hxUhY23lSTVdmTBQ-CA64g6IqjnQG_sMo5Z0bCOOBRveGp__WotPK8SwJ5Q0BlIAaQZKORgYg3YimoIGhRUf0KVqcFyht2yV/s1600/iconprinter.png' title='Print This Page' width='16'/> Print This PageThen please find a code like this or something similar like that.
</div>
<article class='post hentry' expr:id='data:post.id' itemscope='' itemtype='http://schema.org/BlogPosting'>And save the code <div id='printarea'> right after that code so that it becomes like below.
<article class='post hentry' expr:id='data:post.id' itemscope='' itemtype='http://schema.org/BlogPosting'>
<div id='printarea'>
<div style='clear: both;'/> <!-- clear for photos floats -->So it becomes like below.
</div>
<div style='clear: both;'/> <!-- clear for photos floats -->Then save the javascript code below the above code </body>
</div>
</div>
<script type='text/javascript'>Save the template and please try printnya button on page one of your blog posts.
function printContent(el){
var restorepage = document.body.innerHTML;
var printcontent = document.getElementById(el).innerHTML;
document.body.innerHTML = printcontent;
window.print();
document.body.innerHTML = restorepage;
}
</script>
http://www.kompiajaib.com/2014/09/mengatur-print-area-blog-dengan-onclick.html
Leave a comment
To insert a link, use tag
[url=http://your_link]your-link[/url]
To insert the code , use the tag
<i rel="code">your-code</i>
The long code can use the tag
<i rel="pre">your-long-code</i>
To insert an image , use the code
[img]URL Image[/img]
To insert a title , use tag
<b rel="h4">Your Title here...</b>
To creat Bold text
<strong>Your text here...</strong>
To create Italic text used tag
<em>Your text here...</em>