How to DRY coffeescript -


how 1 adhere dry in case (the number of accordions large):

$ ->   $("#accordion-1").accordion     autoheight: false     navigation: true $ ->   $("#accordion-2").accordion     autoheight: false     navigation: true 

it seems can create function generate function selector:

create = (selector) ->   $ ->     $(selector).accordion       autoheight: false       navigation: true 

then:

create "#accordion1" create "#accordion2" 

Comments

Popular posts from this blog

How do you change vbulletin's home page to the forums instead of the default (CMS or Activity Stream)? -

c++ - Troubles when compiling phash program -