Does anyone have any experience with jQuery vAligh plugins or similar?
I tried to align for the following, but it does not work. I used a simple valign plugin (I will put the plugin at the end, its jquery extension), if someone can help, it will be really useful ...
var overlayLayer = $("<div id='office-location'></div>").addClass('modal-overlay'); $('body').append(overlayLayer); $('<div id="content-for-overlay" style="background-color: white;"></div>').appendTo(overlayLayer); this.render({ to: "content-for-overlay", partial: "office-location-modal" });
has the extension fn ..
(function($) { $.fn.vAlign = function() { return this.each(function(i) { var h = $(this).height(); var oh = $(this).outerHeight(); var mt = (h + (oh - h)) / 2; $(this).css("margin-top", "-" + mt + "px"); $(this).css("top", "50%"); $(this).css("position", "absolute"); }); };
}) (Jquery);
jquery html css vertical-alignment
mark smith
source share