开发者

How to close a YUI autocomplete box by clicking an external link

开发者 https://www.devze.com 2023-02-14 01:14 出处:网络
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 .collapseCo开发者_开发知识库n

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 .collapseCo开发者_开发知识库ntainer 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...
});
0

精彩评论

暂无评论...
验证码 换一张
取 消