<html> <head> <title>Печать страницы по двойному клику в любом месте.</title> <script language="JavaScript"> <!-- var showmenu=1
if (document.layers) { document.captureEvents(Event.ONDBLCLICK);} document.ondblclick=dblclick;
if (document.layers){ document.captureEvents(Event.MOUSEMOVE);} document.onmousemove = handlerMM;
function handlerMM(e){ x = (document.layers) ? e.pageX : event.clientX y = (document.layers) ? e.pageY : event.clientY }
function dblclick() { if (document.all && showmenu==1) { document.all.printpic.style.posLeft=x document.all.printpic.style.posLeft=x document.all.printpic.style.posTop=y } if (document.layers && showmenu==1) { document.printpic.left=x document.printpic.left=x document.printpic.top=y } if (document.all && showmenu!=1) { document.all.printpic.style.posLeft=x-10000 } if (document.layers && showmenu!=1) { document.printpic.left=x-10000 } showmenu=showmenu*-1 } // - End of JavaScript - --> </script> </head> <body onDblClick="window.print()"> <div id="printpic"> </div> </body> </html>
|