Skip to content

Instantly share code, notes, and snippets.

@sou-lab
Last active August 29, 2015 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sou-lab/f7638a8d46efbd86bcd5 to your computer and use it in GitHub Desktop.
Save sou-lab/f7638a8d46efbd86bcd5 to your computer and use it in GitHub Desktop.
jQuery Plug-in Format (coffee)
do ($=jQuery) ->
namespace = 'pluginName'
$.fn[namespace] = (options) ->
if @length == 0
return false
settings = $.extend(
# settings default
foo: 'fuga'
bar: 'hoge'
options)
@each ->
#
#each
#
return
return
$ ->
$('selector').pluginName
foo: 'fuga2'
bar: 'hoge2'
return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment