一个貌似win窗口的载入框
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>乡下人 演示</title>
</head>
<BODY STYLE="FONT-SIZE: 10pt; FONT-FAMILY: Verdana, Arial, Helvetica">
<SCRIPT LANGUAGE="JScript">
var NUMBER_OF_REPETITIONS = 40;
var nRepetitions = 0;
var g_oTimer = null;
function startLongProcess()
{
divProgressDialog.style.display = "";
resizeModal();
btnCancel.focus();
// Add a resize handler for the window
window.onresize = resizeModal;
// Add a warning in case anyone tries to navigate away or refresh the page
window.onbeforeunload = showWarning;
//
// Here's where you would normally kick off a long asynchronous process
// like a file download or a remote database operation. Here, we use
// our "long process" to simulate this process.
//
continueLongProcess();
}
function updateProgress(nNewPercent)
{
// Update our pseudo progress bar
divProgressInner.style.width = (parseInt(divProgressOuter.style.width)
* nNewPercent / 100)+ "px";
}
function stopLongProcess()
{
if (g_oTimer != null)
{
// Clear the timer so we don't get called back an extra time
window.clearTimeout(g_oTimer);
g_oTimer = null;
}
// Hide the fake modal DIV
divModal.style.width = "0px";
divModal.style.height = "0px";
divProgressDialog.style.display = "none";
// Remove our event handlers
window.onresize = null;
window.onbeforeunload = null;
nRepetitions = 0;
}
function continueLongProcess()
{
if (nRepetitions < NUMBER_OF_REPETITIONS)
{
// Set the timeout somewhere between 0 and .25 seconds
var nTimeoutLength = Math.random() * 250;
updateProgress(100 * nRepetitions / NUMBER_OF_REPETITIONS);
g_oTimer = window.setTimeout("continueLongProcess();", nTimeoutLength);
nRepetitions++;
}
else
{
stopLongProcess();
}
}
function showWarning()
{
//Warn users before they refresh the page or navigate away
return "Navigating to a different page or refreshing the window could cause you to lose precious data.\n\nAre you*absolutely* certain you want to do this?";
}
function resizeModal()
{
// Resize the DIV which fakes the modality of the dialog DIV
divModal.style.width = document.body.scrollWidth;
divModal.style.height = document.body.scrollHeight;
// Re-center the dialog DIV
divProgressDialog.style.left = ((document.body.offsetWidth -
divProgressDialog.offsetWidth) / 2);
divProgressDialog.style.top = ((document.body.offsetHeight -
divProgressDialog.offsetHeight) / 2);
}
</SCRIPT>
<INPUT TYPE="BUTTON" VALUE="Click Me!" οnclick="startLongProcess();">
<!-- BEGIN PROGRESS DIALOG -->
<div STYLE="BORDER: buttonhighlight 2px outset; FONT-SIZE: 8pt; Z-INDEX:
4; FONT-FAMILY: Tahoma; POSITION: absolute; BACKGROUND-COLOR: buttonface;
DISPLAY: none; WIDTH: 350px; CURSOR: default" ID="divProgressDialog"
onselectstart="window.event.returnValue=false;">
<div STYLE="PADDING: 3px; FONT-WEIGHT: bolder; COLOR: captiontext;
BORDER-BOTTOM: white 2px groove; BACKGROUND-COLOR: activecaption">
Downloading Requested Document
</div>
<div STYLE="PADDING: 5px">
Please wait while I download the document you requested.
</div>
<div STYLE="PADDING: 5px">
This may take several seconds.
</div>
<div STYLE="PADDING: 5px">
<div ID="divProgressOuter" STYLE="BORDER: 1px solid threedshadow;
WIDTH: 336px; HEIGHT: 15px">
<div ID="divProgressInner" STYLE="COLOR: white; TEXT-ALIGN:
center; BACKGROUND-COLOR: infobackground; MARGIN: 0px; WIDTH: 0px; HEIGHT:
13px;"></div>
</div>
</div>
<div STYLE="BORDER-TOP: white 2px groove; PADDING-BOTTOM: 5px; PADDING-TOP: 3px;
BACKGROUND-COLOR: buttonface; TEXT-ALIGN: center">
<INPUT STYLE="FONT-FAMILY: Tahoma; FONT-SIZE: 8pt" TYPE="button"
ID="btnCancel" οnclick="stopLongProcess();" VALUE="Cancel">
</div>
</div>
<!-- END PROGRESS DIALOG -->
<!-- BEGIN FAKE MODAL DIV-->
<div ID="divModal"
STYLE="BACKGROUND-COLOR: white; FILTER: alpha(opacity=75); LEFT: 0px; POSITION:
absolute; TOP: 0px; Z-INDEX: 3"
οnclick="window.event.cancelBubble=true; window.event.returnValue=false;">
</div>
<!-- END FAKE MODAL DIV -->
</body>
</html>
转载于:https://www.cnblogs.com/JemBai/archive/2008/12/17/1356567.html
一个貌似win窗口的载入框相关推荐
- C++ 用DEV-C++建一个Windows窗口程序带文本框和命令按钮
先看一下程序的效果图: 在Dev-C++ 5.11上创建并正常运行,操作系统32位.64位的Win7都可以. 首先在文件菜单里新建项目,选择Windows Application: 命名完成后得到如下 ...
- html点击一个文字显示提示框,点击文字弹出一个DIV层窗口代码
点击文字弹出一个DIV层窗口代码 .black_overlay{ display: none; position: absolute; top: 0%; left: 0%; width: 100%; ...
- c++ win窗口消息演示
/* ========================================================================= 主要功能:c++ win窗口消息演示 ...
- checkbox控件的checked属性作用是_VB6基本控件的使用,制作一个数据输入窗口
一个应用程序少不了数据输入的功能,今天教大家使用控件设计一个数据输入窗口,需要使用到6个控件: Label 文字标签 TextBox 文本框 OptionButton 单选按钮 ComboBox 下拉 ...
- jquery easy ui 1.3.4 窗口,对话框,提示框(5)
5.1.window(窗口) 窗口我们在程序中会大量的使用,比如我们的添加.编辑都可以使用窗口实现,与winform的程序非常的类似.下面的代码是创建一个基本的窗口 $(function () { $ ...
- mesh导出OBJ、STL格式和win窗口调用
记录下开发过程 mesh转OBJ格式 mesh转STL格式 二进制格式(UG打开正常) ASCII格式(UG打开报错) 调用win窗口 导入 导出 注意事项 背景:客户想在UG中打开编辑好的模型,UG ...
- 使用Tkinter编写一个简单的窗口应用
使用Tkinter编写一个简单的窗口应用 文章目录 使用Tkinter编写一个简单的窗口应用 一.前言 二.控件简介 三.实践学习 1. 主窗口的创建以及Label的使用 2. Button的创建使用 ...
- php添加成功关闭窗口,php后台保存数据并指向一个关闭layer窗口的方法
php后台保存数据并指向一个关闭layer窗口的方法 发布时间:2020-08-29 10:13:00 来源:亿速云 阅读:87 作者:小新 这篇文章主要介绍php后台保存数据并指向一个关闭layer ...
- C#代码像QQ的右下角消息框一样,无论现在用户的焦点在哪个窗口,消息框弹出后都不影响焦点的变化,那么有两种方法...
你QQ的右下角消息框一样,无论现在用户的焦点在哪个窗口,消息框弹出后都不影响焦点的变化,那么有两种方法: 要么重写需要弹出的窗体的事件: protected override CreateParams ...
最新文章
- boost::hana::scan_right用法的测试程序
- AMD 发布 Stream SDK for Linux
- linux的system () 函数详解
- JS事件循环机制:同步与异步任务 之 宏任务 微任务
- 中科院自动化所目标跟踪论文整理!三篇综述、两篇ICCV 2019!
- powershell自动化操作AD域、Exchange邮箱系列(1)——powershell 简介
- CentOS7网络快速解决
- android 仿站小工具,仿站小工具下载
- python从excel读取数据用matplotlib画平面折线图
- 计算机里的文件弄不到桌面怎么办,电脑文件夹在桌面不显示怎么办
- 去哪儿庄辰超:不信命运信概率
- Python基础——文件
- 如何进行远程协作办公?
- LeetCode精选101刷题必备(C++)-附详细分类及解体说明
- python二进制写入文件_python读写二进制文件的方法
- C,C++,Python实现兔子生兔子问题
- java基于springboot+vue的旧衣服捐赠系统 毕业设计nodejs技术
- Python基础学习之字典(自用)—henu.hjy
- java 编程式事务管理_spring-编程式事务管理
- 【Neo4j】第 11 章 :在您的 Web 应用程序中使用 Neo4j