JQuery 플러그인 소스 코드 :
/*** jQuery에서 $ .ajax가 잠금 화면 함수를 추가하기 위해 $ .ajax*isasync isasync는 비동기 요청입니다. 기본값은 사실입니다.*Islock은 화면이 잠겨 있는지 여부입니다. 기본값*ISCache는 정보가 브라우저 캐시에서로드되는지 여부 ***/; ($) {$. jQuery.extend ({isasync : true, type : "post", url : null, datatype : null, data : null, success : null, 오류 : Toerror, Islock : True : False}, 설정); $ (this) .Each (function () {if (settings.islock) {locksrc ();} $. ajax ({async : settings.isasync, type : settings.type, url : settings.url, datatype : settings.dat Atype, data : settings.data, cache : settings.iscache, success : function (msg) {if (settings.islock) {unlocksrc ();} settings.success (msg);}, error : settings.error});}); // 잠금 스크린 메소드 함수 locksrc () {$ ( ". lockdiv"). css ({ "불투명도": "0.5"}). fadein ( 'normal'); var scrollwidth = document.documentelement.clientwidth; // document.body.body.clientwidth; var scrollheight = document.documentelement.clientHeight; // document.body.clientHeight; var divwidth = $ ( ". lockdivinfo"). width (); var divheight = $ ( ". lockdivinfo"). height (); var divleft/2-divwidth/2; var divtop = scrollheight/2-divheight/2; // console.log ( "bodywidth ="+scrollwidth+", bodyheight ="+scrollheight+", divheight ="+divheight+", divwidth ="+divwidt h+", 왼쪽 ="+divleft+", top ="+divtop); $ ( ". lockdivinfo"). css ({ "위치": "절대", "상단": "왼쪽": divleft}). fadein ( '정상');} // descreate 스크린 메소드 기능은 UnlockSrc () {$ ( ". lockdivinfo"). fadeout ( 'normal'); $ ( ". lockdiv"). fadeout ( 'normal');} 함수 toerror () {alert ( "작동 실패!");}};} (jquery);잠금 스크린 스타일 :
/*잠금 스크린*/. LockDiv {너비 : 100%; 높이 : 100%; 디스플레이 : 없음; z-index : 10; 배경 색상 : #dfe8f6; 위치 : 절대; 상단 : 0px; 왼쪽 : 0px;}. width : 50px; 높이 : 2px; display : none; left : 0px; 0px; 11} #closediv {float : 오른쪽; 너비 : 100px; 높이 : 100px; 마진-탑 : 10px; 마진-오른쪽 : 10px;}<div> </div> <div> <img id = "closediv"src = "/hnhd/images/circle_animation.gif"> </img> </div>
사용 방법
// query $ ( "#querybtn"). click (function () {selecCheckByregionApp.query ()); var selecCheckByregionApp = {{{{{{{{{{{{{}; selecCheckByregionApp.query = function () {var settion = {taple : "post", url : 'selfcheckstatistion! findbyregreation' , Datatype : "Text", Data : $ ( "#searchform"). Formserialize (), success : function (msg) {$ ( "#contentDiv"). html (msg);}}; $ ( "#querybtn"). dopost (settion);}.