网页特效
建站首页
|
广告代码
|
源码下载
|
站长工具
|
字体下载
|
网页模板
|
收藏本站
|
设为首页
网站首页
菜单导航
日期时间
背景图像
图层样式
鼠标键盘
页面窗口
色彩表格
链接文字
表单按钮
计数转换
游戏娱乐
综合实例
特效
热门搜索:
特效代码
js脚本
导航菜单
热点推荐:
英文字体
人民币汇率
dw插件
站长常用软件
alexa排名查询
您的位置:
网页特效
->
页面窗口
-> 一个非常漂亮的loading效果网页代码
一个非常漂亮的loading效果网页代码
作者:一个非常漂亮的loading效果网页代码 发布时间:2007-11-22 0:08:31 发布人: admin
<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!" onclick="startLongProcess();"> <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" onclick="stopLongProcess();" value="Cancel"> </div> </div> <div id="divModal" style="BACKGROUND-COLOR: white; FILTER: alpha(opacity=75); LEFT: 0px; POSITION: absolute; TOP: 0px; Z-INDEX: 3" onclick="window.event.cancelBubble=true; window.event.returnValue=false;"> </div> </body> </html>
一个非常漂亮的loading效果网页代码
将本文收藏到QQ书签与更多好友分享
上一篇:文章:
将HTML自动转为JS代码输出网页代码
下一篇:文章:
新闻切换选项卡效果网页代码
本类浏览排行 »
搜索页面中的内容
又一款综合搜索引擎代码
标题栏显示当前时间
倒影效果的电子表,显示当前时间
自动记录当前页面最新的更新日期
JS让网页每隔2秒弹出一次对话框
一款超酷的CSS列表排行榜
鼠标悬停放大的纯CSS分页效果
本站推荐文章 »
垂直三栏自适应等高布局
仿QQ消息管理器的文本内容样式
支付宝的控制台动画效果菜单
文字、图片拖曳移动
可拉伸移动的DIV层效果
很酷的图片伸缩放大功能
较好的视觉效果的网页选项卡
CSS实例:通过定义渐变边框给图片加阴影