请问:关闭打印预览窗口返回本页面时,如何执行其它事件??? 是的,想让其关闭后显示其中的Div;有何解决办法呢? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 begin<div id=demo>打印的时候没有</div>end<script>function window.onbeforeprint(){demo.style.display="none"}function window.onafterprint(){demo.style.display=""}</script> <style>@media print{#demo {display:none}}</style>begin<div id=demo>打印的时候没有</div>end begin<div id=demo>打印的时候没有</div>end<object id="WebBrowser" width=0 height=0 classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></object><input type="button" name="Button" value="打印预览" onClick="demo.style.display='none';document.all.WebBrowser.ExecWB(7,1);demo.style.display='';"> 非常感谢qiushuiwuhen(秋水无恨) 再请教一下:在onclick事件中:这个demo.style.display=''能不能放到外面来?即与document.all.WebBrowser.ExecWB(7,1);分离,写在不同的地方 这样的语法不大理解,请解释一下。<style>@media print{#demo {display:none}}</style>还有,如果在点击关闭的时候,还是做其它的操作呢?比如,在预览之前,隐藏了很多按钮,点击关闭后,要将这些按钮显示出来,除了第二种写法外,还有什么办法吗? <style>@media screen{.hs {display:none}}@media print{.hp {display:none}}</style>begin<div class=hp>打印的时候没有</div><button class=hs>打印的时候才有</button><input class=hs value=打印的时候才有>end 其实这些都不是“点击关闭”后发生的,是“点击打印”之后弹出来打印预览窗口后就发生了,由于预览窗口锁定了焦点,所以看起来是一样的。-----------------------------------------------------------------begin <div id=demo>打印的时候没有</div> end<object id="WebBrowser" width=0 height=0 classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></object><input type="button" name="Button" value="打印预览" onClick="demo.style.display='none';document.all.WebBrowser.ExecWB(7,1);demo.style.display='';alert('打印窗口还开着,可是脚本运行完了');">-----------------------------------------------------------------我一开始就在奇怪,有什么事情非要在“关闭打印预览窗口返回本页面”时运行呢? js字符串处理(急) 今天交项目,求助EXT高手 ext editorgridpanel添加侦听事件 已知行驶IP,如何调用Google API把行驶轨迹显示在Google地图上 日语符号无法写入数组 请教一下这段代码在ff下为什么没有效果? JS获取图片大小问题! mail.163.com的界面做得还可以,它的CSS文件下载不了 关于网页对话框的问题 如何给这个进度条程序加一入口,让它真实地反应sample.htm页面的载入进度 向大家推荐一款支持Html,Css,Js,Vbs,Asp,Sql,Vml,Dhtml的软件 JavaScript调用XML的问题
打印的时候没有
</div>end
<script>
function window.onbeforeprint(){
demo.style.display="none"
}
function window.onafterprint(){
demo.style.display=""
}
</script>
@media print{#demo {display:none}}
</style>
begin<div id=demo>
打印的时候没有
</div>end
打印的时候没有
</div>end<object id="WebBrowser" width=0 height=0 classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2">
</object>
<input type="button" name="Button" value="打印预览" onClick="demo.style.display='none';document.all.WebBrowser.ExecWB(7,1);demo.style.display='';">
再请教一下:
在onclick事件中:
这个demo.style.display=''能不能放到外面来?
即与document.all.WebBrowser.ExecWB(7,1);分离,写在不同的地方
<style>
@media print{#demo {display:none}}
</style>
还有,如果在点击关闭的时候,还是做其它的操作呢?比如,在预览之前,隐藏了很多按钮,点击关闭后,要将这些按钮显示出来,除了第二种写法外,还有什么办法吗?
@media screen{.hs {display:none}}
@media print{.hp {display:none}}
</style>
begin
<div class=hp>打印的时候没有</div>
<button class=hs>打印的时候才有</button>
<input class=hs value=打印的时候才有>
end
begin <div id=demo>
打印的时候没有
</div> end<object id="WebBrowser" width=0 height=0 classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2">
</object>
<input type="button" name="Button" value="打印预览" onClick="demo.style.display='none';document.all.WebBrowser.ExecWB(7,1);demo.style.display='';alert('打印窗口还开着,可是脚本运行完了');">
-----------------------------------------------------------------
我一开始就在奇怪,有什么事情非要在“关闭打印预览窗口返回本页面”时运行呢?