Created
July 25, 2012 04:01
-
-
Save mcspring/3174306 to your computer and use it in GitHub Desktop.
Write functionality jQuery code with coffeescript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# utils | |
global_function -> | |
# do something... | |
# if your function is a *process*, known as do not return anything, plus true as the last statement! | |
jQuery ($) -> | |
# global events bind 1 | |
el1 = $ 'selector1' | |
el1.on 'event', (evt) -> | |
# do something... | |
true # or false | |
# global events bind 2 | |
el2 = $ 'selector2' | |
el2.on 'event', (evt) -> | |
# do something... | |
true # or false | |
# page init statements | |
# do something directly... | |
# avoid extra return statement | |
true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment