I have a test site - not finish yet - where I want to place a Print button on a text.
http://sample.image2use.dk/fotoweb/Author5.fwx - look on the "læs aftale" - this is the text - that I want to print.
Best regards
Keld
Code: Select all
hs.Expander.prototype.printHtml = function ()
{
var pw = window.open("about:blank", "_new");
pw.document.open();
pw.document.write(this.getHtmlPrintPage());
pw.document.close();
return false;
};
hs.Expander.prototype.getHtmlPrintPage = function()
{
// We break the closing script tag in half to prevent
// the HTML parser from seeing it as a part of
// the *main* page.
var body = hs.getElementByClass(this.innerContent, 'DIV', 'highslide-body')
|| this.innerContent;
return "<html>\n" +
"<head>\n" +
"<title>Temporary Printing Window</title>\n" +
"<script>\n" +"function step1() {\n" +
" setTimeout('step2()', 10);\n" +
"}\n" +
"function step2() {\n" +
" window.print();\n" +
" window.close();\n" +
"}\n" +
"</scr" + "ipt>\n" +
"</head>\n" +
"<body onLoad='step1()'>\n" +
body.innerHTML +
"</body>\n" +
"</html>\n";
};
Code: Select all
<div class="highslide-html-content" id="print">
<div class="highslide-header">
<ul>
<li>
<a onclick="return hs.getExpander(this).printHtml()" href="javascript:;">Print</a>
</li>
<li class="highslide-move">
<a href="javascript:;" onclick="return false">Move</a>
</li>
<li class="highslide-close">
<a href="javascript:;" onclick="return hs.close(this)">Close</a>
</li>
</ul>
</div>
<div class="highslide-body">
</div>
<div class="highslide-footer">
<div>
<span class="highslide-resize" title="Resize">
<span></span>
</span>
</div>
</div>
</div>
Code: Select all
<a href="i2u_aftale.html" onclick="return hs.htmlExpand(this, { objectType:'ajax', contentId: 'print' } )">Læs aftale</a>