⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 yui-utilities.js

📁 着重用css实现页面显示功能,实现简单数据库连接,是很好的入门教程
💻 JS
📖 第 1 页 / 共 3 页
字号:
 * http://www.extjs.com/license
 */

if(typeof YAHOO=="undefined"){var YAHOO={}}YAHOO.namespace=function(){var A=arguments,E=null,C,B,D;for(C=0;C<A.length;C=C+1){D=A[C].split(".");E=YAHOO;for(B=(D[0]=="YAHOO")?1:0;B<D.length;B=B+1){E[D[B]]=E[D[B]]||{};E=E[D[B]]}}return E};YAHOO.log=function(D,A,C){var B=YAHOO.widget.Logger;if(B&&B.log){return B.log(D,A,C)}else{return false}};YAHOO.init=function(){this.namespace("util","widget","example");if(typeof YAHOO_config!="undefined"){var B=YAHOO_config.listener,A=YAHOO.env.listeners,D=true,C;if(B){for(C=0;C<A.length;C=C+1){if(A[C]==B){D=false;break}}if(D){A.push(B)}}}};YAHOO.register=function(A,E,D){var I=YAHOO.env.modules;if(!I[A]){I[A]={versions:[],builds:[]}}var B=I[A],H=D.version,G=D.build,F=YAHOO.env.listeners;B.name=A;B.version=H;B.build=G;B.versions.push(H);B.builds.push(G);B.mainClass=E;for(var C=0;C<F.length;C=C+1){F[C](B)}if(E){E.VERSION=H;E.BUILD=G}else{YAHOO.log("mainClass is undefined for module "+A,"warn")}};YAHOO.env=YAHOO.env||{modules:[],listeners:[],getVersion:function(A){return YAHOO.env.modules[A]||null}};YAHOO.lang={isArray:function(A){if(A.constructor&&A.constructor.toString().indexOf("Array")>-1){return true}else{return YAHOO.lang.isObject(A)&&A.constructor==Array}},isBoolean:function(A){return typeof A=="boolean"},isFunction:function(A){return typeof A=="function"},isNull:function(A){return A===null},isNumber:function(A){return typeof A=="number"&&isFinite(A)},isObject:function(A){return typeof A=="object"||YAHOO.lang.isFunction(A)},isString:function(A){return typeof A=="string"},isUndefined:function(A){return typeof A=="undefined"},hasOwnProperty:function(A,B){if(Object.prototype.hasOwnProperty){return A.hasOwnProperty(B)}return !YAHOO.lang.isUndefined(A[B])&&A.constructor.prototype[B]!==A[B]},extend:function(D,E,C){var B=function(){};B.prototype=E.prototype;D.prototype=new B();D.prototype.constructor=D;D.superclass=E.prototype;if(E.prototype.constructor==Object.prototype.constructor){E.prototype.constructor=E}if(C){for(var A in C){D.prototype[A]=C[A]}}},augment:function(E,D){var C=E.prototype,F=D.prototype,A=arguments,B,G;if(A[2]){for(B=2;B<A.length;B=B+1){C[A[B]]=F[A[B]]}}else{for(G in F){if(!C[G]){C[G]=F[G]}}}}};YAHOO.init();YAHOO.util.Lang=YAHOO.lang;YAHOO.augment=YAHOO.lang.augment;YAHOO.extend=YAHOO.lang.extend;YAHOO.register("yahoo",YAHOO,{version:"2.2.0",build:"127"});(function(){var C=YAHOO.util,J,H,G=0,I={};var B=navigator.userAgent.toLowerCase(),D=(B.indexOf("opera")>-1),K=(B.indexOf("safari")>-1),A=(!D&&!K&&B.indexOf("gecko")>-1),F=(!D&&B.indexOf("msie")>-1);var E={HYPHEN:/(-[a-z])/i};var L=function(M){if(!E.HYPHEN.test(M)){return M}if(I[M]){return I[M]}while(E.HYPHEN.exec(M)){M=M.replace(RegExp.$1,RegExp.$1.substr(1).toUpperCase())}I[M]=M;return M};if(document.defaultView&&document.defaultView.getComputedStyle){J=function(M,P){var O=null;var N=document.defaultView.getComputedStyle(M,"");if(N){O=N[L(P)]}return M.style[P]||O}}else{if(document.documentElement.currentStyle&&F){J=function(M,O){switch(L(O)){case"opacity":var Q=100;try{Q=M.filters["DXImageTransform.Microsoft.Alpha"].opacity}catch(P){try{Q=M.filters("alpha").opacity}catch(P){}}return Q/100;break;default:var N=M.currentStyle?M.currentStyle[O]:null;return(M.style[O]||N)}}}else{J=function(M,N){return M.style[N]}}}if(F){H=function(M,N,O){switch(N){case"opacity":if(typeof M.style.filter=="string"){M.style.filter="alpha(opacity="+O*100+")";if(!M.currentStyle||!M.currentStyle.hasLayout){M.style.zoom=1}}break;default:M.style[N]=O}}}else{H=function(M,N,O){M.style[N]=O}}YAHOO.util.Dom={get:function(O){if(!O){return null}if(typeof O!="string"&&!(O instanceof Array)){return O}if(typeof O=="string"){return document.getElementById(O)}else{var P=[];for(var N=0,M=O.length;N<M;++N){P[P.length]=C.Dom.get(O[N])}return P}return null},getStyle:function(M,O){O=L(O);var N=function(P){return J(P,O)};return C.Dom.batch(M,N,C.Dom,true)},setStyle:function(M,O,P){O=L(O);var N=function(Q){H(Q,O,P)};C.Dom.batch(M,N,C.Dom,true)},getXY:function(M){var N=function(P){if(P.parentNode===null||P.offsetParent===null||this.getStyle(P,"display")=="none"){return false}var O=null;var U=[];var Q;if(P.getBoundingClientRect){Q=P.getBoundingClientRect();var S=document;if(!this.inDocument(P)&&parent.document!=document){S=parent.document;if(!this.isAncestor(S.documentElement,P)){return false}}var R=Math.max(S.documentElement.scrollTop,S.body.scrollTop);var T=Math.max(S.documentElement.scrollLeft,S.body.scrollLeft);return[Q.left+T,Q.top+R]}else{U=[P.offsetLeft,P.offsetTop];O=P.offsetParent;if(O!=P){while(O){U[0]+=O.offsetLeft;U[1]+=O.offsetTop;O=O.offsetParent}}if(K&&this.getStyle(P,"position")=="absolute"){U[0]-=document.body.offsetLeft;U[1]-=document.body.offsetTop}}if(P.parentNode){O=P.parentNode}else{O=null}while(O&&O.tagName.toUpperCase()!="BODY"&&O.tagName.toUpperCase()!="HTML"){if(C.Dom.getStyle(O,"display")!="inline"){U[0]-=O.scrollLeft;U[1]-=O.scrollTop}if(O.parentNode){O=O.parentNode}else{O=null}}return U};return C.Dom.batch(M,N,C.Dom,true)},getX:function(M){var N=function(O){return C.Dom.getXY(O)[0]};return C.Dom.batch(M,N,C.Dom,true)},getY:function(M){var N=function(O){return C.Dom.getXY(O)[1]};return C.Dom.batch(M,N,C.Dom,true)},setXY:function(M,P,O){var N=function(S){var R=this.getStyle(S,"position");if(R=="static"){this.setStyle(S,"position","relative");R="relative"}var U=this.getXY(S);if(U===false){return false}var T=[parseInt(this.getStyle(S,"left"),10),parseInt(this.getStyle(S,"top"),10)];if(isNaN(T[0])){T[0]=(R=="relative")?0:S.offsetLeft}if(isNaN(T[1])){T[1]=(R=="relative")?0:S.offsetTop}if(P[0]!==null){S.style.left=P[0]-U[0]+T[0]+"px"}if(P[1]!==null){S.style.top=P[1]-U[1]+T[1]+"px"}if(!O){var Q=this.getXY(S);if((P[0]!==null&&Q[0]!=P[0])||(P[1]!==null&&Q[1]!=P[1])){this.setXY(S,P,true)}}};C.Dom.batch(M,N,C.Dom,true)},setX:function(N,M){C.Dom.setXY(N,[M,null])},setY:function(M,N){C.Dom.setXY(M,[null,N])},getRegion:function(M){var N=function(O){var P=new C.Region.getRegion(O);return P};return C.Dom.batch(M,N,C.Dom,true)},getClientWidth:function(){return C.Dom.getViewportWidth()},getClientHeight:function(){return C.Dom.getViewportHeight()},getElementsByClassName:function(O,M,N){var P=function(Q){return C.Dom.hasClass(Q,O)};return C.Dom.getElementsBy(P,M,N)},hasClass:function(O,N){var M=new RegExp("(?:^|\\s+)"+N+"(?:\\s+|$)");var P=function(Q){return M.test(Q["className"])};return C.Dom.batch(O,P,C.Dom,true)},addClass:function(N,M){var O=function(P){if(this.hasClass(P,M)){return }P["className"]=[P["className"],M].join(" ")};C.Dom.batch(N,O,C.Dom,true)},removeClass:function(O,N){var M=new RegExp("(?:^|\\s+)"+N+"(?:\\s+|$)","g");var P=function(Q){if(!this.hasClass(Q,N)){return }var R=Q["className"];Q["className"]=R.replace(M," ");if(this.hasClass(Q,N)){this.removeClass(Q,N)}};C.Dom.batch(O,P,C.Dom,true)},replaceClass:function(P,N,M){if(N===M){return false}var O=new RegExp("(?:^|\\s+)"+N+"(?:\\s+|$)","g");var Q=function(R){if(!this.hasClass(R,N)){this.addClass(R,M);return }R["className"]=R["className"].replace(O," "+M+" ");if(this.hasClass(R,N)){this.replaceClass(R,N,M)}};C.Dom.batch(P,Q,C.Dom,true)},generateId:function(M,O){O=O||"yui-gen";M=M||{};var N=function(P){if(P){P=C.Dom.get(P)}else{P={}}if(!P.id){P.id=O+G++}return P.id};return C.Dom.batch(M,N,C.Dom,true)},isAncestor:function(N,O){N=C.Dom.get(N);if(!N||!O){return false}var M=function(Q){if(N.contains&&!K){return N.contains(Q)}else{if(N.compareDocumentPosition){return !!(N.compareDocumentPosition(Q)&16)}else{var P=Q.parentNode;while(P){if(P==N){return true}else{if(!P.tagName||P.tagName.toUpperCase()=="HTML"){return false}}P=P.parentNode}return false}}};return C.Dom.batch(O,M,C.Dom,true)},inDocument:function(M){var N=function(O){return this.isAncestor(document.documentElement,O)};return C.Dom.batch(M,N,C.Dom,true)},getElementsBy:function(S,N,O){N=N||"*";var P=[];if(O){O=C.Dom.get(O);if(!O){return P}}else{O=document}var R=O.getElementsByTagName(N);if(!R.length&&(N=="*"&&O.all)){R=O.all}for(var Q=0,M=R.length;Q<M;++Q){if(S(R[Q])){P[P.length]=R[Q]}}return P},batch:function(Q,M,P,O){var N=Q;Q=C.Dom.get(Q);var U=(O)?P:window;if(!Q||Q.tagName||!Q.length){if(!Q){return false}return M.call(U,Q,P)}var S=[];for(var R=0,T=Q.length;R<T;++R){if(!Q[R]){N=Q[R]}S[S.length]=M.call(U,Q[R],P)}return S},getDocumentHeight:function(){var N=(document.compatMode!="CSS1Compat")?document.body.scrollHeight:document.documentElement.scrollHeight;var M=Math.max(N,C.Dom.getViewportHeight());return M},getDocumentWidth:function(){var N=(document.compatMode!="CSS1Compat")?document.body.scrollWidth:document.documentElement.scrollWidth;var M=Math.max(N,C.Dom.getViewportWidth());return M},getViewportHeight:function(){var M=self.innerHeight;var N=document.compatMode;if((N||F)&&!D){M=(N=="CSS1Compat")?document.documentElement.clientHeight:document.body.clientHeight}return M},getViewportWidth:function(){var M=self.innerWidth;var N=document.compatMode;if(N||F){M=(N=="CSS1Compat")?document.documentElement.clientWidth:document.body.clientWidth}return M}}})();YAHOO.util.Region=function(C,D,A,B){this.top=C;this[1]=C;this.right=D;this.bottom=A;this.left=B;this[0]=B};YAHOO.util.Region.prototype.contains=function(A){return(A.left>=this.left&&A.right<=this.right&&A.top>=this.top&&A.bottom<=this.bottom)};YAHOO.util.Region.prototype.getArea=function(){return((this.bottom-this.top)*(this.right-this.left))};YAHOO.util.Region.prototype.intersect=function(E){var C=Math.max(this.top,E.top);var D=Math.min(this.right,E.right);var A=Math.min(this.bottom,E.bottom);var B=Math.max(this.left,E.left);if(A>=C&&D>=B){return new YAHOO.util.Region(C,D,A,B)}else{return null}};YAHOO.util.Region.prototype.union=function(E){var C=Math.min(this.top,E.top);var D=Math.max(this.right,E.right);var A=Math.max(this.bottom,E.bottom);var B=Math.min(this.left,E.left);return new YAHOO.util.Region(C,D,A,B)};YAHOO.util.Region.prototype.toString=function(){return("Region {"+"top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+", left: "+this.left+"}")};YAHOO.util.Region.getRegion=function(D){var F=YAHOO.util.Dom.getXY(D);var C=F[1];var E=F[0]+D.offsetWidth;var A=F[1]+D.offsetHeight;var B=F[0];return new YAHOO.util.Region(C,E,A,B)};YAHOO.util.Point=function(A,B){if(A instanceof Array){B=A[1];A=A[0]}this.x=this.right=this.left=this[0]=A;this.y=this.top=this.bottom=this[1]=B};YAHOO.util.Point.prototype=new YAHOO.util.Region();YAHOO.register("dom",YAHOO.util.Dom,{version:"2.2.0",build:"127"});

⌨️ 快捷键说明

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