欢迎访问:常州市武进区嘉泽中心小学网站 !今天是:
栏目列表
您现在的位置是:首页>>教师>>计算机技术>>网站制作技术>>文章内容
刚找到的js暂停函数,共享出来给大家
发布时间:2008-11-20   点击:   来源:本站原创   录入者:佚名
 

刚找到的js暂停函数,共享出来给大家。
主要是利用模式对话框会将下层窗口的程序暂停的功能。看代码就知道了。缺点就是暂停的时候你不能操作页面上的任何东西。
  function pause(numberMillis) {
        var dialogScript =
           'window.setTimeout(' +
           ' function () { window.close(); }, ' + numberMillis + ');';
        var result =
// For IE5.
         window.showModalDialog(
           'javascript:document.writeln(' +
            '"<script>' + dialogScript + '<' + '/script>")');

/* For NN6, but it requires a trusted script.
         openDialog(
           'javascript:document.writeln(' +
            '"<script>' + dialogScript + '<' + '/script>"',
           'pauseDialog', 'modal=1,width=10,height=10');
 */
     }



附件:
    关闭窗口
    打印文档
    账号登录
    保持登录 忘记密码?
    账号与武进教师培训平台同步