Simulate the Vista window effect

Source: Internet
Author: User
Tip: you can modify some code before running

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>-</title><style>body {margin:0px}#Loading {position:absolute;z-index:1000;left:10px;top:10px;width:10px;height:10px}#Loading_Bg {position:absolute;z-index:999;left:0px;top:0px;background:#000000;width:100%;height:100%;filter:alpha(opacity=30);-moz-opacity:0.3;opacity:0.3;}.LoadContent {width:100%;height:100%;overflow:auto}</style><script LANGUAGE="JavaScript"> <!-- function $(){return document.getElementById?document.getElementById(arguments[0]):eval(arguments[0]);}var OverH,OverW,ChangeDesc,ChangeH=50,ChangeW=50;function OpenDiv(_Dw,_Dh,_Desc) {$("Loading").innerHTML="";OverH=_Dh;OverW=_Dw;ChangeDesc=_Desc;$("Loading").style.display='';$("Loading").style.border="1px #666666 dashed";$("Loading").style.backgroundColor="";$("Loading_Bg").style.display='';var _H=document.body.scrollHeight;if(_H<document.documentElement.clientHeight)_H=document.documentElement.clientHeight;$("Loading_Bg").style.height=_H+"px";if(_Dw>_Dh){ChangeH=Math.ceil((_Dh-10)/((_Dw-10)/50))}else if(_Dw<_Dh){ChangeW=Math.ceil((_Dw-10)/((_Dh-10)/50))}OpenNow()}var Nw=10,Nh=10;function OpenNow() {if (Nw>OverW-ChangeW)ChangeW=2;if (Nh>OverH-ChangeH)ChangeH=2;Nw=Nw+ChangeW;Nh=Nh+ChangeH;if(OverW>Nw||OverH>Nh) { if(OverW>Nw) { $("Loading").style.width=Nw+"px"; var _L=(document.documentElement.clientWidth-Nw)/2;if(_L<0)_L=0; $("Loading").style.left=_L+"px"; } if(OverH>Nh) { $("Loading").style.height=Nh+"px"; var _T=(document.documentElement.clientHeight-Nh)/2;if(_T<0)_T=0; $("Loading").style.top=_T+"px" } window.setTimeout("OpenNow()",10) }else{ Nw=10;Nh=10;ChangeH=50;ChangeW=50; $("Loading").style.border="1px #666666 solid"; $("Loading").style.backgroundColor="#eeeeee";//这里是开始加载时的loading事件,可以插入图片 $("Loading").innerHTML="Loading..."; AjaxGet(ChangeDesc) }}function CloseLoad() {if(Nw!=10) return;$("Loading").style.display='none';$("Loading_Bg").style.display='none';}//创建XML对象function createXMLHttps(){var ret = null;try {ret = new ActiveXObject('Msxml2.XMLHTTP')}catch (e) { try {ret = new ActiveXObject('Microsoft.XMLHTTP')} catch (ee) {ret = null} }if (!ret&&typeof XMLHttpRequest !='undefined') ret = new XMLHttpRequest();return ret;}function AjaxGet(URL) {var xmlhttp = createXMLHttps();xmlhttp.open("Get",URL,true);xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");xmlhttp.onreadystatechange = function() {if (xmlhttp.readyState == 4 && xmlhttp.status==404) {$("Loading").innerHTML='读取页面失败,文件'+URL+'不存在!';return}if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { $("Loading").innerHTML="<div class='LoadContent'>"+xmlhttp.responseText+"</div>"; } }xmlhttp.send(null);}//--></script> </head><body><font color=red>UTF-8 encoding is recommended for the target file.</font><br><br>A.html 500*300<br><br>B .html 500*200<br><br>1. html 200*500<br><br>2. html 500*500<br><br>Close double-click layer<div id="Loading_Bg" ></div><div id="Loading" ondblclick="CloseLoad()"></div></body></html>
Tip: you can modify some code before running

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.