I am writing a jquery plugin in coffeescript but am not sure how to get the function wrapper part right.
My coffeescript starts with this:
$.fn.exten
This is all I had to do in order to add my own method, cleanFadeIn
, on jQuery objects. It returns the objects for chaining as well:
$.fn.extend
cleanFadeIn: -> # $('.notice').cleanFadeIn
return $(@).each -> # returns the objects for easy chaining.
$(@).slideDown 'slow', ->
$(@).fadeTo 'slow', 1