Search

3/10/2009

AutoComplete.prototype._onContainerMouseover

AutoComplete.prototype._onContainerMouseover


YAHOO.widget.AutoComplete.prototype._onContainerMouseover = function(v,oSelf) {
var elTarget = YAHOO.util.Event.getTarget(v);
var elTag = elTarget.nodeName.toLowerCase();
while(elTarget && (elTag != "table")) {
switch(elTag) {
case "body":
return;
case "li":
if(oSelf.prehighlightClassName) {
oSelf._togglePrehighlight(elTarget,"mouseover");
}
else {
oSelf._toggleHighlight(elTarget,"to");
}

oSelf.itemMouseOverEvent.fire(oSelf, elTarget);
break;
case "div":
if(YAHOO.util.Dom.hasClass(elTarget,"yui-ac-container")) {
oSelf._bOverContainer = true;
return;
}
break;
default:
break;
}

elTarget = elTarget.parentNode;
if(elTarget) {
elTag = elTarget.nodeName.toLowerCase();
}
}
};


YAHOO.widget.AutoComplete.prototype._onContainerMouseout = function(v,oSelf) {
var elTarget = YAHOO.util.Event.getTarget(v);
var elTag = elTarget.nodeName.toLowerCase();
while(elTarget && (elTag != "table")) {
switch(elTag) {
case "body":
return;
case "li":
if(oSelf.prehighlightClassName) {
oSelf._togglePrehighlight(elTarget,"mouseout");
}
else {
oSelf._toggleHighlight(elTarget,"from");
}

oSelf.itemMouseOutEvent.fire(oSelf, elTarget);
break;
case "ul":
oSelf._toggleHighlight(oSelf._elCurListItem,"to");
break;
case "div":
if(YAHOO.util.Dom.hasClass(elTarget,"yui-ac-container")) {
oSelf._bOverContainer = false;
return;
}
break;
default:
break;
}

elTarget = elTarget.parentNode;
if(elTarget) {
elTag = elTarget.nodeName.toLowerCase();
}
}
};

沒有留言: