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

📄 ygddswap.js

📁 SugarCRM5.1 开源PHP客户关系管理系统
💻 JS
字号:
function ygDDSwap(id,sGroup){this.swapInit(id,sGroup);}ygDDSwap.prototype=new YAHOO.util.DDProxy();ygDDSwap.prototype.swapInit=function(id,sGroup){if(!id){return;}this.init(id,sGroup);this.initFrame();this.logger=new ygLogger("ygDDSwap");this.offClass="testSquare";this.onClass="testSquareOn";this.els=[];};ygDDSwap.prototype.onDragDrop=function(e,id){this.swap(this.getEl(),YAHOO.util.DDM.getElement(id));};ygDDSwap.prototype.swap=function(el1,el2){this.logger.debug(this.id+" onDragDrop swap");var s1=el1.style;var s2=el2.style;var l=s1.left;var t=s1.top;s1.left=s2.left;s1.top=s2.top;s2.left=l;s2.top=t;};ygDDSwap.prototype.onDragEnter=function(e,id){this.logger.debug(this.id+" dragEnter "+id);this.els[id]=true;var el=YAHOO.util.DDM.getElement(id);if(el.className!=this.onClass){el.className=this.onClass;}};ygDDSwap.prototype.onDragOut=function(e,id){this.logger.debug(this.id+" dragOut "+id);YAHOO.util.DDM.getElement(id).className=this.offClass;};ygDDSwap.prototype.endDrag=function(e){this.logger.debug(this.id+" endDrag");this.resetStyles();};ygDDSwap.prototype.resetStyles=function(){for(var i in this.els){var el=YAHOO.util.DDM.getElement(i);if(el){el.className=this.offClass;}}};ygDDSwap.prototype.onDrag=function(e){};ygDDSwap.prototype.onDragOver=function(e){};ygDDSwap_i.prototype=new ygDDSwap();function ygDDSwap_i(id,sGroup){this.swapInit(id,sGroup);}ygDDSwap_i.prototype.onDragDrop=function(e,dds){var dd=YAHOO.util.DDM.getBestMatch(dds);this.swap(this.getEl(),dd.getEl());};ygDDSwap_i.prototype.onDragEnter=function(e,dds){};ygDDSwap_i.prototype.onDragOver=function(e,dds){this.resetStyles();var dd=YAHOO.util.DDM.getBestMatch(dds);this.els[dd.id]=true;var el=dd.getEl();if(el.className!=this.onClass){el.className=this.onClass;}};ygDDSwap_i.prototype.onDragOut=function(e,dds){for(var i=0;i<dds.length;++i){dds[i].getEl().className=this.offClass;}};

⌨️ 快捷键说明

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