Revision: 33831
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at October 14, 2010 01:33 by virgil
Initial Code
(function ($) { // VERTICALLY ALIGN FUNCTION $.fn.vAlign = function() { return this.each(function(i){ var ah = $(this).height(); var ph = $(this).parent().height(); var mh = (ph - ah) / 2; $(this).css('margin-top', mh); }); }; })(jQuery);
Initial URL
Initial Description
usage: $('div img').vAlign();
Initial Title
Vertically align
Initial Tags
Initial Language
jQuery