Hi,
I need to detect whether a particular accordion item displays its contents correctly on the browser showing the page in question. In order to do that I am using javascript/jQuery with a mouseup() event handler.
$("div#mydiv").find("a.x-accordion-toggle").mouseup(function(){
var thisvar = this;
setTimeout(function(){
if($(thisvar).attr("class") != "x-accordion-toggle collapsed"){
//....actions to take to check display is ok
},300);
});
Since the accordion item will take some time after mouseup before the contents are displayed, I need to put in a setTimeout() function – however, this feels slightly inelegant and you can never be sure how much the time lag will vary between individual machines/browsers.
Is there a way to specifically detect the event that the accordion opening is complete?