WeiWeiXinNet/Games/game3/js/other/windowStack.js

(开头部分) 9KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

var windowStacks = [];
function windowCreate(sId, bShow) {
	var oWindow = new windowStack(document.getElementById(sId));
	if (bShow) {
		oWindow.show();
	}
	return oWindow;
}
function windowStack(element) {
	if (element != null && typeof element == "object") {
		this.lastOpacity = null;
		this.domObject = element;
		this.hadFocus = true;
		this.hookedMouse = false;
		var thisObj2 = this;
		this.events = [
			["mousedown", function (event) { thisObj2.dragEnable(event); }],
			["mousemove", function (event) { thisObj2.drag(event); }],
			["mouseup", function (event) { thisObj2.dragDisable(); }]
		];
	}
	else {
		cout("In windowStack::windowStack() : The DOM element passed was invalid.", 2);
	}
}
windowStack.prototype.registerMouseEvents = function () {
	if (!this.hookedMouse) {
		this.hookedMouse = true;
		cout("windowStack::registerMouseEvents() called.", -1);
		for (eventIndex in this.events) {
			addEvent(this.events[eventIndex][0], document, this.events[eventIndex][1]);
		}
		this.center();
	}
	else {
		cout("In windowStack::registerMouseEvents() : this.hookedMouse reported true, ignoring request to register mouse events.", 1);
	}
}
windowStack.prototype.unregisterMouseEvents = function () {
	if (this.hookedMouse) {
		this.hookedMouse = false;
		cout("windowStack::unregisterMouseEvents() called.", -1);
		for (eventIndex in this.events) {
			removeEvent(this.events[eventIndex][0], document, this.events[eventIndex][1]);
		}
	}
	else {
		cout("In windowStack::unregisterMouseEvents() : this.hookedMouse reported false, ignoring request to unregister mouse events.", 1);
	}
}
windowStack.prototype.getStyleFloatOf = function (propertyNameOf, JSpropertyNameOf) {
	cout("windowStack::getStyleFloatOf() called.", -1);
	try {
		var dirtyValue = window.getComputedStyle(this.domObject, null).getPropertyValue(propertyNameOf);
	}
	catch (error) {
		try {
			var dirtyValue = this.domObject.currentStyle.getAttribute(JSpropertyNameOf);	/*JS object notation style keywords, not the CSS keywords!*/
		}
		catch (error) {
后面还有 161 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。