iLexN
6/18/2013 - 2:34 AM

center js

center js

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() ) / 2+$(window).scrollLeft() + 'px');return this;}