chrome 實測正常
頁面的列印:
<a href='#' class='notprint' onclick='pagesetup_null();self.print();'><img src=../images/printer.png border=0 title='列印' ></a>
不列印頁眉頁腳:
<script language="javascript">var hkey_root,hkey_path,hkey_keyhkey_root="HKEY_CURRENT_USER"hkey_path="//Software//Microsoft//Internet Explorer//PageSetup//"function pagesetup_null(){try{var RegWsh = new ActiveXObject("WScript.Shell")
hkey_key="header"RegWsh.RegWrite(hkey_root+hkey_path+hkey_key,"")hkey_key="footer"RegWsh.RegWrite(hkey_root+hkey_path+hkey_key,"")}catch(e){}}
</script>
某些元素不列印: 未測
<style>
@media print { .notprint { display:none;
}
}
@media screen { .notprint { display:inline;
cursor:hand;
}
}
</style>
文章標籤
全站熱搜
