loading.js

来自「This is the script which used on 10minut」· JavaScript 代码 · 共 54 行

JS
54
字号
/** * Default loading implementation * * @category	HTML * @package	Ajax * @license	http://www.opensource.org/licenses/lgpl-license.php  LGPL * @copyright	2005 Joshua Eichorn * see Main.js for license Author details */HTML_AJAX.Open = function(request) {	var loading = document.getElementById('HTML_AJAX_LOADING');	if (!loading) {		loading = document.createElement('div');		loading.id = 'HTML_AJAX_LOADING';		loading.innerHTML = 'Please wait while loading...';				loading.style.color	 = '#fff';		loading.style.position  = 'absolute';		loading.style.top   = 0;		loading.style.right	 = 0;		loading.style.backgroundColor = '#f00';		loading.style.border		= '1px solid #f99';		loading.style.width		 = '80px';		loading.style.padding	   = '4px';		loading.style.fontFamily	= 'Arial, Helvetica, sans';		loading.count = 0;			document.body.insertBefore(loading,document.body.firstChild);	}	else {		if (loading.count == undefined) {			loading.count = 0;		}	}	loading.count++;	if (request.isAsync) {		request.loadingId = window.setTimeout(function() { loading.style.display = 'block'; },0);	}	else {		loading.style.display = 'block';	}}HTML_AJAX.Load = function(request) {	if (request.loadingId) {		window.clearTimeout(request.loadingId);	}	var loading = document.getElementById('HTML_AJAX_LOADING');	loading.count--;	if (loading.count == 0) {		loading.style.display = 'none';	}}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?