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

📄 coreclasses.js

📁 在流览器上仿CS界面的JAVASCRIPT脚本
💻 JS
📖 第 1 页 / 共 5 页
字号:
this.removeStyleProperty("backgroundImage");else this.setStyleProperty("backgroundImage","url("+sUri+")");};_p.getBackgroundImage=function(){var s=this.getStyleProperty("backgroundImage");return s.replace(/^url\(/i,"").replace(/\)$/,"");};_p.setOpacity=function(n){if(this._opacity!=n){n=Math.max(0,Math.min(1,n));this._opacity=n;if(BiBrowserCheck.ie)
{n=Math.round(n*100);if(n==100)
this.removeStyleProperty("filter");else this.setStyleProperty("filter","Alpha(Opacity="+n+")");}
else {if(n==1)
this.removeStyleProperty("MozOpacity");else this.setStyleProperty("MozOpacity",n);}}};BiComponent.prototype.getOpacity=function(){return this._opacity;};_p.setLeft=function(nLeft){if(this._left!=nLeft){this._left=nLeft;this.layoutComponentX();}};_p.setRight=function(nRight){if(this._right!=nRight){this._right=nRight;this.layoutComponentX();}};_p.setTop=function(nTop){if(this._top!=nTop){this._top=nTop;this.layoutComponentY();}};_p.setBottom=function(nBottom){if(this._bottom!=nBottom){this._bottom=nBottom;this.layoutComponentY();}};_p.setWidth=function(nWidth){if(this._width!=nWidth){this._width=nWidth;this.layoutComponentX();}};_p.setHeight=function(nHeight){if(this._height!=nHeight){this._height=nHeight;this.layoutComponentY();}};_p.setSize=function(nWidth,nHeight){if(this._width!=nWidth||this._height!=nHeight){this._width=nWidth;this._height=nHeight;if(this._created)
this.layoutComponent();}};_p.setLocation=function(nLeft,nTop){if(this._left!=nLeft||this._top!=nTop){this._left=nLeft;this._top=nTop;if(this._created)
this.layoutComponent();}};_p.setBounds=function(nLeft,nTop,nWidth,nHeight){if(this._left!=nLeft||this._top!=nTop||this._width!=nWidth||this._height!=nHeight){this._left=nLeft;this._top=nTop;this._width=nWidth;this._height=nHeight;if(this._created)
this.layoutComponent();}};_p.layoutComponentX=function(){var p;if(this._created&&(p=this._parent))
p.layoutChildX(this);};_p.layoutComponentY=function(){var p;if(this._created&&(p=this._parent))
p.layoutChildY(this);};_p.layoutComponent=function(){var p;if(this._created&&(p=this._parent))
p.layoutChild(this);};_p.layoutChildX=function(oChild){if(this._layoutChildX(oChild)&&oChild._children.length>0)
oChild.layoutAllChildrenX();};if(BiBrowserCheck.ie)
{_p._layoutChildX=function(oChild)
{var w;var cw;if(oChild._left!=null)
{oChild.setStyleProperty("pixelLeft",oChild._left);if(oChild._right!=null)
{cw=this.getClientWidth();w=cw-oChild._left-oChild._right;oChild.setStyleProperty("pixelWidth",w);}
else if(oChild._width!=null)
{w=oChild._width;oChild.setStyleProperty("pixelWidth",w);}}
else if(oChild._right!=null)
{if(oChild._width!=null)
w=oChild._width;else {oChild.removeStyleProperty("pixelWidth");oChild.removeStyleProperty("width");w=oChild.getWidth();}
cw=this.getClientWidth();oChild.setStyleProperty("pixelLeft",cw-w-oChild._right);oChild.setStyleProperty("pixelWidth",w);}
else if(oChild._width)
{w=oChild._width;oChild.setStyleProperty("pixelWidth",w);}
var widthChanged=w!=oChild._measuredWidth;oChild._measuredWidth=w;return widthChanged;};}
else {_p._layoutChildX=function(oChild)
{var w;var cw;if(oChild._left!=null)
{oChild.setStyleProperty("left",oChild._left+"px");if(oChild._right!=null)
{cw=this.getClientWidth();w=cw-oChild._left-oChild._right;oChild.setStyleProperty("width",Math.max(0,w)+"px");}
else if(oChild._width!=null)
{w=oChild._width;oChild.setStyleProperty("width",Math.max(0,w)+"px");}}
else if(oChild._right!=null)
{if(oChild._width!=null)
w=oChild._width;else {oChild.removeStyleProperty("width");w=oChild.getWidth();}
cw=this.getClientWidth();oChild.setStyleProperty("left",cw-w-oChild._right+"px");oChild.setStyleProperty("width",Math.max(0,w)+"px");}
else if(oChild._width)
{w=oChild._width;oChild.setStyleProperty("width",Math.max(0,w)+"px");}
var widthChanged=w!=oChild._measuredWidth;oChild._measuredWidth=w;return widthChanged;};}
_p.layoutChildY=function(oChild){if(this._layoutChildY(oChild)&&oChild._children.length>0)
oChild.layoutAllChildrenY();};if(BiBrowserCheck.ie)
{_p._layoutChildY=function(oChild)
{var h;var ch;if(oChild._top!=null)
{oChild.setStyleProperty("pixelTop",oChild._top);if(oChild._bottom!=null)
{ch=this.getClientHeight();h=ch-oChild._top-oChild._bottom;oChild.setStyleProperty("pixelHeight",h);}
else if(oChild._height!=null)
{h=oChild._height;oChild.setStyleProperty("pixelHeight",h);}}
else if(oChild._bottom!=null)
{var h;if(oChild._height!=null)
h=oChild._height;else {oChild.removeStyleProperty("pixelHeight");oChild.removeStyleProperty("height");oChild._element.runtimeStyle.display="";h=oChild.getHeight();}
ch=this.getClientHeight();oChild.setStyleProperty("pixelTop",ch-h-oChild._bottom);oChild.setStyleProperty("pixelHeight",h);}
else if(oChild._height)
{h=oChild._height;oChild.setStyleProperty("pixelHeight",h);}
var heightChanged=h!=oChild._measuredHeight;if(BiBrowserCheck.ie&&heightChanged)
oChild._element.runtimeStyle.display=h==0?"none":"";oChild._measuredHeight=h;return heightChanged;};}
else {_p._layoutChildY=function(oChild)
{var h;var ch;if(oChild._top!=null)
{oChild.setStyleProperty("top",oChild._top+"px");if(oChild._bottom!=null)
{ch=this.getClientHeight();h=ch-oChild._top-oChild._bottom;oChild.setStyleProperty("height",Math.max(0,h)+"px");}
else if(oChild._height!=null)
{h=oChild._height;oChild.setStyleProperty("height",Math.max(0,h)+"px");}}
else if(oChild._bottom!=null)
{var h;if(oChild._height!=null)
h=oChild._height;else {oChild.removeStyleProperty("height");h=oChild.getHeight();}
ch=this.getClientHeight();oChild.setStyleProperty("top",ch-h-oChild._bottom+"px");oChild.setStyleProperty("height",Math.max(0,h)+"px");}
else if(oChild._height)
{h=oChild._height;oChild.setStyleProperty("height",Math.max(0,h)+"px");}
var heightChanged=h!=oChild._measuredHeight;oChild._measuredHeight=h;return heightChanged;};}
_p.layoutChild=function(oChild){var x=this._layoutChildX(oChild);var y=this._layoutChildY(oChild);if(oChild._children.length>0){if(x&&y)
oChild.layoutAllChildren();else if(x)
oChild.layoutAllChildrenX();else if(y)
oChild.layoutAllChildrenY();}};_p.layoutAllChildrenX=function(){var cs=this._children;var l=cs.length;for(var i=0;i<l;i++)
cs[i].layoutComponentX();};_p.layoutAllChildrenY=function(){var cs=this._children;var l=cs.length;for(var i=0;i<l;i++)
cs[i].layoutComponentY();};_p.layoutAllChildren=function(){var cs=this._children;var l=cs.length;for(var i=0;i<l;i++)
cs[i].layoutComponent();};_p.getLeft=function(){if(this._created)return this._element.offsetLeft;else return this._left;};_p.getRight=function(){if(this._created&&this._parent){return this._parent.getClientWidth()-this.getLeft()-this.getWidth();}
throw new Error("Visual property on non created component");};_p.getTop=function(){if(this._created)return this._element.offsetTop;else return this._top;};_p.getBottom=function(){if(this._created&&this._parent){return this._parent.getClientHeight()-this.getTop()-this.getHeight();}
throw new Error("Visual property on non created component");};_p.getWidth=function(){if(this._created)return this._element.offsetWidth;else return this._width;};_p.getHeight=function(){if(this._created)return this._element.offsetHeight;else return this._height;};_p.getClientWidth=function(){if(!this._created)
throw new Error("Visual property on non created component");return this._element.clientWidth;};_p.getClientHeight=function(){if(!this._created)
throw new Error("Visual property on non created component");return this._element.clientHeight;};_p.getInsetLeft=function(){if(!this._created)
throw new Error("Visual property on non created component");if(BiBrowserCheck.ie)
return this._element.clientLeft;else {var rtl=this.getRightToLeft();var el=this._element;var cs=this._document.defaultView.getComputedStyle(el,"");if(!rtl)
return parseInt(cs.borderLeftWidth);return el.offsetWidth-el.clientWidth-parseInt(cs.borderRightWidth);}};_p.getInsetRight=function(){if(!this._created)
throw new Error("Visual property on non created component");if(BiBrowserCheck.ie)
{return this._element.offsetWidth-this._element.clientLeft-this._element.clientWidth;}
else {var rtl=this.getRightToLeft();var el=this._element;var cs=this._document.defaultView.getComputedStyle(el,"");if(rtl)
return parseInt(cs.borderRightWidth);return el.offsetWidth-el.clientWidth-parseInt(cs.borderLeftWidth);}};_p.getInsetTop=function(){if(!this._created)
throw new Error("Visual property on non created component");if(BiBrowserCheck.ie)
return this._element.clientTop;else {return parseInt(window.getComputedStyle(this._element,"").borderTopWidth);}};_p.getInsetBottom=function(){if(!this._created)
throw new Error("Visual property on non created component");if(BiBrowserCheck.ie)
{return this._element.offsetHeight-this._element.clientTop-this._element.clientHeight;}
else {var el=this._element;var cs=this._document.defaultView.getComputedStyle(el,"");return el.offsetHeight-el.clientHeight-parseInt(cs.borderTopWidth);}};_p.getClientLeft=function(){if(!this._created)
throw new Error("Visual property on non created component");if(BiBrowserCheck.ie)
return this._element.getBoundingClientRect().left;else {var el=this._element;var doc=this._document;var win=doc.defaultView;var bo=doc.getBoxObjectFor(el);var bl=parseInt(win.getComputedStyle(el,"").borderLeftWidth);var sum=0;var p=this._element.parentNode;while(p.nodeType==1)
{sum+=p.scrollLeft;p=p.parentNode;}
return bo.x-bl-sum;}};_p.getClientTop=function(){if(!this._created)
throw new Error("Visual property on non created component");if(BiBrowserCheck.ie)
return this._element.getBoundingClientRect().top;else {var el=this._element;var doc=this._document;var win=doc.defaultView;var bo=doc.getBoxObjectFor(el);var bt=parseInt(win.getComputedStyle(el,"").borderTopWidth);var sum=0;var p=this._element.parentNode;while(p.nodeType==1)
{sum+=p.scrollTop;p=p.parentNode;}
return bo.y-bt-sum;}};_p.getScreenLeft=function(){if(!this._created)
throw new Error("Visual property on non created component");if(BiBrowserCheck.ie)
return this.getClientLeft()+this._document.parentWindow.screenLeft;else {var sum=0;var p=this._element.parentNode;while(p.nodeType==1)
{sum+=p.scrollLeft;p=p.parentNode;}
return this._document.getBoxObjectFor(this._element).screenX-sum;}};_p.getScreenTop=function(){if(!this._created)
throw new Error("Visual property on non created component");if(BiBrowserCheck.ie)
return this.getClientTop()+this._document.parentWindow.screenTop;else {var sum=0;var p=this._element.parentNode;while(p.nodeType==1)
{sum+=p.scrollTop;p=p.parentNode;}
return this._document.getBoxObjectFor(this._element).screenY-sum;}};_p._getScreenClientArea=function()
{return{left:this.getScreenLeft()+this.getInsetLeft(),top:this.getScreenTop()+this.getInsetTop(),width:this.getClientWidth(),height:this.getClientHeight()};};if(BiBrowserCheck.ie)
{_p.getPreferredWidth=function(){if(this._preferredWidth!=null)
return this._preferredWidth;if(!this._created)
throw new Error("Visual property on non created component");return this.getInsetLeft()+this.getScrollWidth()+this.getInsetRight();};_p.getPreferredHeight=function(){if(this._preferredHeight!=null)
return this._preferredHeight;if(!this._created)
throw new Error("Visual property on non created component");return this.getInsetTop()+this.getScrollHeight()+this.getInsetBottom();};}

⌨️ 快捷键说明

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