0

4 つの DIV があり、それにアコーディオン関数を呼び出します。最初は問題なく動作します。しかし、すべてのコンテンツをクリアして再度 4 つの DIV を追加すると失敗します。

リンク http://jsfiddle.net/p7vUk/2/をご覧ください。

divA をクリックすると、divAA がトグルをスライドすることがわかります。divB をクリックすると、divBB がトグルをスライドします。

「すべてクリア」ボタンをクリックすると、div=content がクリアされ、同じ 4 つの DIVS が追加されますが、jquery アコーディオンは機能しません。

4

1 に答える 1

0

The accordion styling and behaviour is defined upon creation. Looks like the accordion does not update when the content changes. Nor does there appear to be a method you can call to trigger an update.

Have you tried 'turning it off and on again'?

//change content, then:
$("#content").accordion("destroy");
$("#content").accordion({ ... your options ... }); //create it again

This may require more related work, such as setting the originally selected tab, etc.

于 2012-08-09T03:45:39.207 に答える