I have an autocomplete box which I would like to be able to close when the user clicks a link. I think I would just have to somehow "get" the autocomplete, then use the .collapseContainer method.

I don't know how to "get" a YUI object, though, or if that's even possible.

有帮助吗?

解决方案

Thanks to Matt Parker at the YUI Library forums for this one:

YAHOO.util.Event.on("myLinkElement","click", function(ev){
  myAutoComplete.collapseContainer();
  // whatever else...
});
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top