Hacker News new | ask | show | jobs
by olavk 6581 days ago
I really like this DSL aspect of jQuery!

I wonder however if a plugin could define its own namespace, like:

    $('blah').draggable().create({options}).css(..)...
    $('blah').draggable().destroy().css(..)...
draggable() returns a wrapper that exposes only the dragging specific methods, but the underlying jQuery is passed through and returned by any method called on the wrapper. That way you don't have to add all methods in the same namespace.

On second thought I don't know if this wouldn't just be confusing :-)