I am trying to apply the jQuery accordion element to the HTML created in a Backbone.js view.
When I try and invoke the accordion after the render it does not take effect e.g.
messageListView.render();
$("#messages").accordion();
I have to invoke the accordion in a delay for it to take effect:
setTimeout(function() { $("#messages").accordion() }, 100);
Any insight into why this might be the case. Should I expect all DOM rendering to be completed by the time the render() method on the view is called?
cowper
The Problem ist probably that you try to call
$("#messages").accordion();before your view is attached to the DOM.