initPosition : function () {
this.data = [],this.allBlocks = [];
var areaLen = this.moveableArea.length;
for (var j = 0; j < areaLen; j++ ) {
var areaId = this.moveableArea[j];
var area = $(areaId);
var areaData = [];
if (typeof area == 'undefined' || area == null) continue;
if (typeof area == 'object') {
this.checkTempDiv(areaId);
var frames = area.childNodes;
for (var i in frames) {
if (typeof(frames[i]) != 'object') continue;
if (Util.hasClass(frames[i], this.frameClass) || Util.hasClass(frames[i], this.blockClass)
|| Util.hasClass(frames[i], this.tabClass) || Util.hasClass(frames[i], this.moveableObject)) {
areaData.push(this.initFrame(frames[i]));
}
}
this.data[areaId] = areaData;
}
}
this._replaceFlag = true;
},
this.data = [],this.allBlocks = [];
var areaLen = this.moveableArea.length;
for (var j = 0; j < areaLen; j++ ) {
var areaId = this.moveableArea[j];
var area = $(areaId);
var areaData = [];
if (typeof area == 'undefined' || area == null) continue;
if (typeof area == 'object') {
this.checkTempDiv(areaId);
var frames = area.childNodes;
for (var i in frames) {
if (typeof(frames[i]) != 'object') continue;
if (Util.hasClass(frames[i], this.frameClass) || Util.hasClass(frames[i], this.blockClass)
|| Util.hasClass(frames[i], this.tabClass) || Util.hasClass(frames[i], this.moveableObject)) {
areaData.push(this.initFrame(frames[i]));
}
}
this.data[areaId] = areaData;
}
}
this._replaceFlag = true;
},
initPosition 基本都是什么移动,初始化定位的函数。你要把完整的代码发来,或者说下你在哪里看见这个代码,我基本就知道它是做什么的了。
o = {A:"属性",initPosition :function(){alert("方法")}}
alert(o.A)
o.initPosition();
</script>
e = Util.event(e);
if(!this.dragObj) {return false;} //拖动对象存在才会继续
document.onscroll = function(){}; //拖动滚动条事件
window.onscroll = function(){};
document.onmousemove = function(e){};
document.onmouseup = '';
if (this.tmpBoxElement.parentNode) {
if (this.tmpBoxElement.parentNode == document.body) {
document.body.removeChild(this.tmpBoxElement); //removeChild可从子节点列表中删除某个节点
document.body.removeChild(this.dragObj);
this.fn = ''; //之前的:this.fn = function (e) {drag.getBlockData(contentType);};
} else {
Util.removeClass(this.dragObj,this.moving);
this.dragObj.style.display = 'none';
this.dragObj.style.width = '' ;
this.dragObj.style.top = '';
this.dragObj.style.left = '';
this.dragObj.style.zIndex = '';
this.dragObj.style.position = 'relative';
this.dragObj.style.backgroundColor = '';
this.isDragging = false ;
this.tmpBoxElement.parentNode.replaceChild(this.dragObj, this.tmpBoxElement);
Util.fadeIn(this.dragObj); //元素逐渐显示
this.tmpBoxElement='';
this._setCssPosition(this.dragObjFrame, 'relative');
this.doEndDrag();
this.initPosition();
if (!(this.dargRelative.up == this.dragObj.previousSibling && this.dargRelative.down == this.dragObj.nextSibling)) {
this.setClose();
}
this.dragObjFrame = this.overObjFrame = null;
}
}