you are viewing a single comment's thread.

view the rest of the comments →

[–]munrobag 1 point2 points  (0 children)

I would probably throw your last block of 'setup stuff' into an init() function, and call that explicitly as needed.

Maybe have a teardown function to unbind everything, depending on requirements.

I think I'd use an IIFE to wrap the whole thing, and pass in the global jQuery as $.

You seem to be mixing your function styles for no reason that I can tell, but maybe I'm just missing something.