Return to Snippet

Revision: 18285
at September 26, 2009 09:40 by metoikos


Initial Code
jQuery.fn.center = function () {
this.css("position","absolute");
this.css("top", ( $(window).height() - this.height() ) / $(window).scrollTop() + "px");
this.css("left", ( $(window).width() - this.width() ) / $(window).scrollLeft() + "px");
return this;
}

Initial URL


Initial Description


Initial Title
jquery center content to page

Initial Tags
jquery

Initial Language
JavaScript