簡體   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