Joel Birch wrote:
> On another note, would it be better if my "over" and "out" functions  
> were attached to the jQuery object, and defined outside of the  
> plugin, eg:
>
> $.sfOut = function(){
>       ...
> };
>
> instead of:
>
> var out = function(){
>       ...
> };
>
> Would that be better? If so, why? Would it mean that the functions  
> only occupy one place in the memory instead of once per instance of  
> Superfish menu?
>
> Joel.
>   
Joel,

  I wrote those reviews/changes @ 4am, and after more thought realize 
most of them were unnecessary. The original code would work @ multiple 
menus at once without the return this.each(...); The reasons I began 
with that is I wanted to do my "serializing" within the .each statement, 
instead of the "over" function (at first). Also, as for settimeout 
returning an integer instead of a referencing function, this would 
eliminate the need for the serializing in the first place -- unless of 
course, you want to attach more data to the element (such as item 
specific timeout values, effects, etc).

  As for attaching your functions over/out functions to the jQuery 
object -- I would not do this... unless you need them available 
globally. Having them within the scope of the plugin is more appropriate.

~ Brice

_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to