0

I'm trying to mix the accordion and the autocomplete plugins into one single solution.

It is working ok, exept for a few detail. I can't find how to close the accordion after an element of the autocomplete is clicked.

JS fiddle with the code: http://jsfiddle.net/yBKjd/1/

Graphic explanation: Accordion-autocomplete example

The code I'm using is the following:

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

            });
4

1 回答 1

1

只需用普通的 jquery 隐藏手风琴:

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

于 2012-10-23T17:58:31.093 回答