繁体   English   中英

jQuery UI手风琴。 触发事件时如何关闭手风琴?

[英]Jquery UI accordion. How to close the accordion when fired an event?

我正在尝试将手风琴和自动完成插件混合到一个解决方案中。

一切正常,仅提供一些细节。 单击自动完成的元素后,我找不到如何关闭手风琴。

JS摆弄代码: http : //jsfiddle.net/yBKjd/1/

图形说明: 手风琴自动完成示例

我正在使用的代码如下:

 $("#tags").autocomplete({
                                  source: availableTags,
                                  minLength: 0,

                                  select: function(event, ui)
                                  { 
                                      alert('I would like to close the accordion in this moment')
                                  },

                                  open: function()
                                  {
                                      $(this).autocomplete("widget")
                                      .appendTo("#demo-description")
                                      .css("position", "static");
                                  }
                              }).on("focus", function ()
            {
                $(this).autocomplete("search", '');   

            });

只需用简单的jquery隐藏手风琴即可:

$('#demo-description')。hide();

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM