jQuery UI Accordion performance

jQuery UI Accordion performance

Hi all, I 'm using a jQuery UI Accordion and I'm noting that it has an awfull slow transition. And I only have 5 elements on the Accordion.

I have this HTML

  1. <div id="msgContainer">
  2.           <h3><a href="./somewhere.php">A Header</a></h3>
  3.           <div><p>Content</p></div>
  4. </div>

The pairs <h3> and <div> repeats within a foreach loop 5 times
And I have this JS:

  1. $(document).ready(function(){
  2. $("#msgContainer").accordion({
  3. active: false, 
  4. collapsible: true,
  5. autoHeight: false,
  6. change: markMessageAsRead
  7. });
  8. $.getScript("../../js/common/more.js");
  9. });
  10. function markMessageAsRead(event, ui) {
  11. var elText = ui.newHeader.text();
  12. var laPosLeido = elText.indexOf("-");
  13. var laPosRespo = elText.indexOf("[")
  14. if( laPosLeido != -1 ) 
  15.  var elNewText = elText.substring(0, laPosLeido);
  16. else 
  17.  var elNewText = elText;
  18. elNewText += " - Leido";
  19. if ( laPosRespo != -1 )
  20.  elNewText += " [Respondido]";
  21. ui.newHeader.children("a").text(elNewText);
  22. ui.newHeader.children("a").css({"font-style":"italic", "color":"#3399CC"});
  23. if (ui.newHeader.children("a").attr("href") !== undefined)
  24.  if (ui.newHeader.children("a").attr("href").indexOf("f") == -1) {
  25.  $.ajax({
  26.  type: "GET",
  27.  url: ui.newHeader.children("a").attr("href"),
  28.  global: false,
  29.  success: function(res) { alert(res); },
  30.  error: function(xhr, status) { alert(status + ": " + xhr.responseText); }
  31.  });
  32.  var href = ui.newHeader.children("a").attr("href");
  33.  href += "&f=1";
  34.  ui.newHeader.children("a").attr("href", href);
  35.  }
  36. }


The manipulation of the href and stuff is required, but for the issue I'm telling [I guess] it doesn't matter.
Which is that the Accordion is incredibly slow and clumsy; anybody knows why or have any clues ??

jQuery version: 1.4.2
jQuery UI version: 1.8.1

The app is inside an intranet, if someone requires a live demo to test, I maybe could put a sample of that part only ...

Thank to all