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

📄 paneset-states.js

📁 zapatec suite 最新版 20070204,非常棒的ajax widgets 工具包
💻 JS
字号:
// $Id: paneset-states.js 6651 2007-03-19 10:15:22Z slip $/** * Checks if needed state was reached and tryes to fire function exactly when it needs. * @param state [string] - required state; * @param func [function] - function needed to be fired * @param first [boolean] - should the handler be called first * @return true if the state was already reached */Zapatec.PaneSet.prototype.fireOnState = function(state, func) {	var self = this;	if (state == "body_loaded") {		if (!this.stateReached("created")) {			return false;		}		if (!Zapatec.windowLoaded) {			setTimeout(function() {func.call(self);}, 50);			return false;		}				return true;	}	if (!this.stateReached(state)) {		if (!this.stateReached("created")) {			return false;		}		first = this.systemEventsOn;		this.addEventListener(state, func, first);				return false;	} else {		return true;	}};/** * Changes the state of the widget, firing all the events planned * @param state [string] - state to set. * @return true if succeeds, otherwise false */Zapatec.PaneSet.prototype.changeState = function(state) {	this.widgetState = state;	this.fireEvent(state);	return true;};/** * This method tells you wether the state you need was reached or maybe already passed. * Right now we have following states: * 'shown' - object is visible; * @param state [string] - the name of the state you need to check; * @return - true if the state was reached or already passed, otherwise false */Zapatec.PaneSet.prototype.stateReached = function(state) {	//getting current state priority.	//if there is no such in our priority array we give it the highest priority, 	//which means count of states avaliable in the array.	var currentState = this.priorities[this.widgetState] || (this.priorities[this.widgetState] !== 0 ? this.priorities.count : 0);	//getting passed state priority.	//if there is no such in our priority array we give it the highest priority, 	//which means count of states avaliable in the array.	state = this.priorities[state] || (this.priorities[state] !== 0 ? this.priorities.count : 0);	//and now compareing them	if (state > currentState) {return false;}	return true;};

⌨️ 快捷键说明

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