views:

159

answers:

2

I'm wring a custom jQuery plugin based on the awesome jGrowl plugin. I just need it to do a few more things than it already does.

Basically everything is working as I need it to (only tested in Firefox so far) except that if you call the plugin too many times too fast it stops and breaks everything

http://jsbin.com/ofejo/edit

Any ideas about what might cause this?

A: 

It's rendering and trying to calculate where to place the block but failing because there's an animation already taking place. (often an animation changes the type of display style being used in order to create the effect and this causes oddities with calculations such as these)

You need to queue the effect, but I'm not precisely sure how you would go about it because you're creating new elements, and there's more source code than I am willing to look through at the moment. Let me know if this helps.

altCognito
+1  A: 

sounds like you need to implement a callback feature and put the additional calls into callbacks to ensure that the plugin processes before other executions occur.

Jon Erickson