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

📄 allcatepop_c.js

📁 这个是一个很不错的 js效果(表格突出显示)希望对大家有所帮助
💻 JS
📖 第 1 页 / 共 3 页
字号:
if (!elem.name) {
var i = this._nParentSeeks;
var parentElem = goN2U.getParentElement(elem);
while ( parentElem && i ) {
if (parentElem.name) {
elem = parentElem;
break;
}
parentElem = goN2U.getParentElement(parentElem);
i--;
}
}		
if ((name = elem.name) && goN2U.isUndefOrNull(elem.onmouseout)) {
if (this._attachEventsToLink(elem, name)) {
;
if (goN2U.bIsIE && elem.getAttribute("onmouseover")){
;
elem.onmouseover();
} else if (elem['onmouseover']){	// Mozillla
;
elem['onmouseover']();
} else {
;
}
} 
}
} else {
;
}
var bIsInInstance = false;
var oRegFeature = null;		// non-null if bIsInInstance
var sInstanceName = null; 	// non-null if bIsInInstance
if (elem) {
var oFeature = this._searchForActiveFeature(elem); // see fixme comment on _searchForActiveFeature
if (oFeature) {
var oInstance = oFeature.getActiveWrappedFInstance();
;
bIsInInstance = true;
oRegFeature = oInstance.getRegFeatureOpened();
sInstanceName = oInstance.getInstanceName();
}
}
if (!bIsInInstance && elem && elem.name) {
var nameArray = elem.name.split("|");
if (nameArray.length >= N2Events.nMINHOTSPOTNAMECOMPONENTS) {
var oLNI = goN2U.getLinkNameInfo(elem.id);
if (oLNI) {
var sFeatureID = oLNI.getFeature();
oRegFeature = this.lookupRegFeature(sFeatureID);
if (oRegFeature) {
var oFeature = oRegFeature.getFeature();
bIsInInstance = true;
sInstanceName = oFeature.getHotspotInstanceName(oLNI);
}
}
}
}
this.broadcastMouseOwner(oRegFeature, sInstanceName);
}
this.addEventHandler = function(eventID, fn) {
var r;
if (window.addEventListener) {
window.addEventListener(eventID, fn, false);
r = true;
} else if (window.attachEvent)	{
r = document.attachEvent("on"+eventID, fn);
} else {
;			
r = false;
}
;
return r;
}
this.removeEventHandler = function(eventID, fn) {
var r;
if (window.removeEventListener) {
window.addEventListener(eventID, fn, false);
r = true;
} else if (window.detachEvent)	{
r = document.detachEvent("on"+eventID, fn);
} else {
;			
r = false;
}
;
return r;
}
this.toggleObjects = function(etype, element)
{
var thisLeft;
var thisTop;
var thisRight;
var thisBottom;
if (etype != "hide") {
;
} else {
var oElement = goN2U.getRawObject(element);
if (!oElement) {
;
return;
}
;
thisLeft = goN2U.getObjectLeft(oElement);		
thisTop = goN2U.getObjectTop(oElement);	
thisRight = thisLeft + goN2U.getObjectWidth(oElement);
thisBottom = thisTop + goN2U.getObjectHeight(oElement);
}
this._checkPopOverObjects("EMBED", etype, thisLeft, thisTop, thisRight, thisBottom);
this._checkPopOverObjects("OBJECT", etype, thisLeft, thisTop, thisRight, thisBottom);
if (goN2U.bIsIE) {
this._checkPopOverObjects("select", etype, thisLeft, thisTop, thisRight, thisBottom);
}
}
this._checkPopOverObjects = function(tagName, etype, thisLeft, thisTop, thisRight, thisBottom) {
var myObjs = document.getElementsByTagName(tagName);
var i;
for (i=0; i<myObjs.length; i++) {
var oElem = myObjs[i];
if ((oElem.id && oElem.id.substring(0,4) == '_po_' ) ||
(oElem.name && oElem.name.substring(0,4) == '_po_') ) {
continue;
}
if (etype != "hide") {
oElem.style.visibility = "visible";
} else {
oElem.style.visibility = this._isFInstanceOverElement(thisLeft, thisTop, thisRight, thisBottom, oElem) ? "hidden" : "visible";
}
}
}
this._isFInstanceOverElement = function(thisLeft, thisTop, thisRight, thisBottom, menuObj)
{
var mL = goN2U.getObjectLeft(menuObj);
var mT = goN2U.getObjectTop(menuObj);
var mR = mL + goN2U.getObjectWidth(menuObj);
var mB = mT + goN2U.getObjectHeight(menuObj);
var pL = thisLeft;
var pT = thisTop;
var pR = thisRight;
var pB = thisBottom;
if ( (mL >= pL) && (mL <= pR) && (mT >= pT) && (mT <= pB) )  return true;
if ( (mL >= pL) && (mL <= pR) && (mB >= pT) && (mB <= pB) )  return true;
if ( (mR >= pL) && (mR <= pR) && (mT >= pT) && (mT <= pB) )  return true;
if ( (mR >= pL) && (mR <= pR) && (mB >= pT) && (mB <= pB) )  return true;
if ( (mL >= pL) && (mL <= pR) && (mT <= pT) && (mB >= pB) )  return true; 
if ( (pL >= mL) && (pL <= mR) && (pT >= mT) && (pT <= mB) )  return true;
if ( (pL >= mL) && (pL <= mR) && (pB >= mT) && (pB <= mB) )  return true;
if ( (pR >= mL) && (pR <= mR) && (pT >= mT) && (pT <= mB) )  return true;
if ( (pR >= mL) && (pR <= mR) && (pB >= mT) && (pB <= mB) )  return true;
return false;
}
this.disableFeature = function(featureID, delay) {
var oFeature = this.lookupFeature(featureID);
;
if (oFeature) {
oFeature.disableFeature(nMSDelay);
}
}
this.featureIsDisabled = function(featureID) {
var bDisabled = false;
var oFeature = this.lookupFeature(featureID);
;
if (oFeature) {
bDisabled = oFeature.isDisabled();
}
return bDisabled;
}
this.qaAddIDsToNamedLinks = function() {
var mylinks = document.getElementsByTagName("a");
for (var i=0; i<mylinks.length; i++) {
var name = mylinks[i].getAttribute("name");
if (name) {
var nameArray = name.split("|");
if ( nameArray.length>=N2Events.nMINHOTSPOTNAMECOMPONENTS && !mylinks[i].id ) {
mylinks[i].setAttribute("id","lnx"+this._nextAvailId);
;
this._nextAvailId++;
}
}
}
}
this.invokeFeature = function(linkID, bShow, sNameOverride, nFeatureFlags) {
var elem = goN2U.getRawObject(linkID);
if (elem == null) {
;
return;
}
nFeatureFlags |= this.fSTATICWITHCLOSE;
var oLNI = goN2U.getLinkNameInfo(linkID, sNameOverride);
if (!oLNI) {
;
return;
}
var oFeature = 	this.lookupFeature(oLNI.getFeature());
var oFInstance = oFeature.getFeatureInstance(oLNI);
if (!oFInstance && bShow) {
oFInstance = oFeature.createFeatureInstance(oLNI);
}
if (!oFInstance) {
;
return;
}
if (bShow) {
;
oFInstance.openNow(oLNI, nFeatureFlags);
} else {
;
oFInstance.closeNow();
}
}
this.qaTestFeature = function(sLinkID, bShow, sNameOverride, sFlags){
;
this.invokeFeature(sLinkID, bShow, sNameOverride, sFlags)
}
this.mouseOverHotspotOpen = function(hotspotElement, nFeatureFlags) {
;
var oRegFeature = null;
var oFeature = null;
var sInstanceName;
var oHInstance = null;
var oLNI = goN2U.getLinkNameInfo(hotspotElement.id);
if (oLNI) {
oRegFeature = goN2Events.lookupRegFeature(oLNI.getFeature());
oFeature = oRegFeature.getFeature();
sInstanceName = oFeature.getHotspotInstanceName(oLNI);
oHInstance = oFeature.getHotspotInstance(oLNI);
}
this.broadcastMouseOwner(oRegFeature, sInstanceName);
if (oHInstance) {
oHInstance.mouseOverOpen(oLNI, nFeatureFlags);
} else {
;
}
}
this.mouseOverHotspotTrack = function(hotspotElement, bOpenFeature, nFeatureFlags) {
;
var oRegFeature = null;
var oFeature = null;
var sInstanceName;
var oLNI = goN2U.getLinkNameInfo(hotspotElement.id);
if (oLNI) {
oRegFeature = goN2Events.lookupRegFeature(oLNI.getFeature());
oFeature = oRegFeature.getFeature();
sInstanceName = oFeature.getHotspotInstanceName(oLNI);
}
this.broadcastMouseOwner(oRegFeature, sInstanceName);
}
this.mouseClickHotspotOpen = function(hotspotElement, nFeatureFlags) {
;
var oRegFeature = null;
var oFeature = null;
var oHInstance = null;
var oLNI = goN2U.getLinkNameInfo(hotspotElement.id);
if (oLNI) {
oRegFeature = goN2Events.lookupRegFeature(oLNI.getFeature());
oFeature = oRegFeature.getFeature();
oHInstance = oFeature.getHotspotInstance(oLNI);
}
this.broadcastMouseOwner(oRegFeature, oFeature.getHotspotInstanceName(oLNI));
if (oHInstance) {
oHInstance.mouseClickOpen(oLNI, nFeatureFlags);
} else {
;//goN2Debug.warning("N2Events mouseClickHotspotOpen -- unknown hotspot '" + (oFeature ? oFeature.getHotspotInstanceName(oLNI) : "") +	"'");
}
return false; 
}
this.mouseOutHotspotClose = function(hotspotElement) {
;
var oRegFeature = null;
var oFeature = null;
var oHInstance = null;
var oLNI = goN2U.getLinkNameInfo(hotspotElement.id);
if (oLNI) {
oRegFeature = goN2Events.lookupRegFeature(oLNI.getFeature());
oFeature = oRegFeature.getFeature();
oHInstance = oFeature.getHotspotInstance(oLNI);
}
if (oHInstance) {
oHInstance.mouseOutClose(oLNI);
} else {
;//goN2Debug.warning("N2HEvents mouseOutHotspotClose -- unknown hotspot '" +  (oFeature ? oFeature.getHotspotInstanceName(oLNI) : "") + "'");
}
if (oRegFeature) {
this.instanceIsNotMouseOwner(oRegFeature, oFeature.getHotspotInstanceName(oLNI));
}
}
this.mouseOutHotspotTrack = function(hotspotElement) {
;
var oLNI = goN2U.getLinkNameInfo(hotspotElement.id);
if (oLNI) {
var oRegFeature = goN2Events.lookupRegFeature(oLNI.getFeature());
if (oRegFeature) {
this.instanceIsNotMouseOwner(oRegFeature, oRegFeature.getFeature().getHotspotInstanceName(oLNI));
}
}
}
this._getFInstanceFromCallbackArg = function(oFInstanceOrWrappedFeature) {
var oFInstance;
if (!goN2U.objIsInstanceOf(oFInstanceOrWrappedFeature, N2FInstance)) {
var oFeature = this._getFeatureFromWrappedFeature(oFInstanceOrWrappedFeature);
;
oFInstance = oFeature.getActiveWrappedFInstance();
;
} else {
oFInstance = oFInstanceOrWrappedFeature;
;
}
return oFInstance;
}
this.mouseOverFeature = function(oFInstanceOrWrappedFeature) {
;
if (!oFInstanceOrWrappedFeature) {
;
return;
}
var oFInstance = this._getFInstanceFromCallbackArg(oFInstanceOrWrappedFeature);
if (oFInstance) {
this.broadcastMouseOwner(oFInstance.getRegFeatureOpened(), oFInstance.getInstanceName());
oFInstance.mouseOver();
}
}
this.mouseOutFeature = function(oFInstanceOrWrappedFeature) {
; 
if (!oFInstanceOrWrappedFeature) {
;
return;
}
var oFInstance = this._getFInstanceFromCallbackArg(oFInstanceOrWrappedFeature);
if (oFInstance) {
this.instanceIsNotMouseOwner(oFInstance.getRegFeatureOpened(), oFInstance.getInstanceName());
oFInstance.mouseOut();
}
}
this.overlayClosed = function(oFInstanceOrWrappedFeature) {
; 
if (!oFInstanceOrWrappedFeature) {
;
return;
}
var oFInstance = this._getFInstanceFromCallbackArg(oFInstanceOrWrappedFeature);
oFInstance.overlayClosed();
this.toggleObjects("show");
; 
}
this.overlayChanged = function(oFInstanceOrWrappedFeature) {
; 
if (!oFInstanceOrWrappedFeature) {
;
return;
}
var oFInstance = this._getFInstanceFromCallbackArg(oFInstanceOrWrappedFeature);
if (goN2U.bIsIE) {
if (this._featureChangedTimer) {
clearTimeout(this._featureChangedTimer);
}
this._featureChangedTimer = setTimeout("goN2Events._overlayChangedTimerAction('"+oFInstance.getRawObject().id+"')", 200);
}
}
this._overlayChangedTimerAction = function(sElementID) {
; 
this.toggleObjects("show", sElementID);
this.toggleObjects("hide", sElementID);
this._featureChangedTimer = null;
}
}
window.N2Events.fNONSTATIC = 0;
window.N2Events.fSEMISTATIC = 1;
window.N2Events.fSTATICWITHCLOSE = 3;
window.N2Events.nMINHOTSPOTNAMECOMPONENTS = 2; // name="feature|type|key..." must have at least feature and type
window.goN2Events = new N2Events();
goN2Events.initialize();
window.n2InitEvents = function() {
;
}
window.qaAddIDsToNamedLinks = function() { goN2Events.qaAddIDsToNamedLinks(); };
window.n2MouseOverFeature = function(oFInstanceOrWrappedFeature) { goN2Events.mouseOverFeature(oFInstanceOrWrappedFeature); }
window.n2MouseOutFeature = function(oFInstanceOrWrappedFeature) { goN2Events.mouseOutFeature(oFInstanceOrWrappedFeature); }
window.n2OverlayClosed = function(oFInstanceOrWrappedFeature) { goN2Events.overlayClosed(oFInstanceOrWrappedFeature); }
window.n2OverlayChanged = function(oFInstanceOrWrappedFeature) { goN2Events.overlayChanged(oFInstanceOrWrappedFeature); }
window.n2MouseOverHotspotNop = function() {
if (typeof goN2Events == "object") {
return goN2Events.mouseOverHotspotTrack(this);
}
} 
window.n2MouseOverHotspot = function() {
if (typeof goN2Events == "object") {
return goN2Events.mouseOverHotspotOpen(this, N2Events.fNONSTATIC);
}
} 
window.n2MouseOverHotspotStatic = function() { 
if (typeof goN2Events == "object") {
return goN2Events.mouseOverHotspotOpen(this, N2Events.fSTATICWITHCLOSE); 
}
}
window.n2MouseOverHotspotSemiStatic = function() { 
if (typeof goN2Events == "object") {
return goN2Events.mouseOverHotspotOpen(this, N2Events.fSEMISTATIC); 
}
}
window.n2HotspotClick = function() {
if (typeof goN2Events == "object") {
return goN2Events.mouseClickHotspotOpen(this, N2Events.fNONSTATIC); 
}
}
window.n2HotspotClickStatic = function() { 
if (typeof goN2Events == "object") {
return goN2Events.mouseClickHotspotOpen(this, N2Events.fSTATICWITHCLOSE); 
}
}
window.n2HotspotClickSemiStatic = function() { 
if (typeof goN2Events == "object") {
return goN2Events.mouseClickHotspotOpen(this, N2Events.fSEMISTATIC); 
}
}
window.n2MouseOutHotspotNop = function() { 
if (typeof goN2Events == "object") {
goN2Events.mouseOutHotspotTrack(this); 
}
}
window.n2MouseOutHotspot = function() {
if (typeof goN2Events == "object") {
if (window.event && event.toElement && event.toElement.id == goN2U.sAnimationDivID) {
;
return;
}
goN2Events.mouseOutHotspotClose(this);
}
}
window.n2HotspotDisableFeature = function(nMs, oFInstanceOrWrappedFeature) {
if (typeof goN2Events != "object") {
return;
}
if (!oFInstanceOrWrappedFeature) {
;
return;
}
;
var oFeature;
if (_n2ObjectIsFInstance(oFInstanceOrWrappedFeature)) {
var oFInstance = oFInstanceOrWrappedFeature;
oFeature = oFInstance.getFeature();
} else {
oFeature = goN2Events._getFeatureFromWrappedFeature(oFInstanceOrWrappedFeature);
;
}
oFeature.disableFeature(nMS);
return true;
}
if (window.goN2LibMon) goN2LibMon.endLoad('events');
} // END library code wrapper
n2RunIfLoaded("utilities", n2EventsInitLibrary, "events");

⌨️ 快捷键说明

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