2012-10-23 145 views
0

我試圖將手風琴和自動完成插件混合成一個單一的解決方案。Jquery UI手風琴。如何在開展活動時關閉手風琴?

它工作正常,免除一些細節。點擊自動完成元素後,我無法找到如何關閉手風琴。

JS撥弄代碼:http://jsfiddle.net/yBKjd/1/

圖文解釋: Accordion-autocomplete example

我正在使用的代碼如下:

$("#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", ''); 

      }); 

回答

1

只是隱藏與純jQuery的手風琴:

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