[jquery] elements are displayed in the center

From , 5 Years ago, written in JavaScript, viewed 95 times.
URL https://pastebin.vip/view/767d01b4
  1.     (function($) {  
  2.         jQuery.fn.center = function () {  
  3.             this.css('position','absolute');  
  4.              this.css('top', ( $(window).height() - this.height() ) / +$(window).scrollTop() + 'px');  
  5.              this.css('left', ( $(window).width() - this.width() ) / 2+$(window).scrollLeft() + 'px');  
  6.              return this;  
  7.         }  
  8.     })(jQuery);  //调用:$("#macoArea").center();
  9.  
  10. //javascript/1070

Reply to "[jquery] elements are displayed in the center"

Here you can reply to the paste above

captcha

https://burned.cc - Burn After Reading Website