vgquotes/Src/VideoGameQuotes.Web/media/js/jquery.center.js
tmont 25172d14a3 * compressed javascript
* renamed css file
* removed copypaste code for js includes
* added pdn files
* changed unused images/javascript build type from Content to None
2011-03-01 00:11:17 +00:00

8 lines
332 B
JavaScript

(function($){
$.fn.center = function() {
var fixed = this.css("position") === "fixed";
this.css("top", ($(window).height() - this.height()) / 2 + (fixed ? 0 : $(window).scrollTop()) + "px");
this.css("left", ($(window).width() - this.width()) / 2 + (fixed ? 0 : $(window).scrollLeft()) + "px");
return this;
};
}(jQuery));