Skip to content

Instantly share code, notes, and snippets.

@christopherstyles
Created November 2, 2012 23:43
Show Gist options
  • Save christopherstyles/4005055 to your computer and use it in GitHub Desktop.
Save christopherstyles/4005055 to your computer and use it in GitHub Desktop.
$.fn.vAlign
$.fn.vAlign = ->
@each (i) ->
ah = $(this).height()
ph = $(this).parent().height()
mh = (ph - ah) / 2
$(this).css "margin-top", mh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment