Skip to content

Instantly share code, notes, and snippets.

@carlthuringer
Created June 20, 2011 15:31
Show Gist options
  • Save carlthuringer/1035828 to your computer and use it in GitHub Desktop.
Save carlthuringer/1035828 to your computer and use it in GitHub Desktop.
Coffeescript Syntax oddities
$('div').live 'pagebeforeshow', (event, ui)->
$('#statistics').height(70)
$('#stats-grid-plus-minus a').toggle(->
$(this).parents('#statistics').animate({ height: "170px"}, 500)
->
$(this).parents('#statistics').animate({ height: "70px"}, 500)
)
$('div').live('pagebeforeshow', function(event, ui) {
$('#statistics').height(70);
return $('#stats-grid-plus-minus a').toggle(function() {
return $(this).parents('#statistics').animate({
height: "170px"
}, 500);
}, function() {
return $(this).parents('#statistics').animate({
height: "70px"
}, 500);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment