Dynamically control the center display of web page elements through jQuery custom jQuery plug-in

From , 3 Years ago, written in JavaScript, viewed 53 times.
URL https://pastebin.vip/view/cd17d3ce
  1.    // $(element).center();
  2.     jQuery.fn.center = function ()
  3.     {
  4.         this.css("position","absolute");
  5.         this.css("top", ( $(window).height() - this.height() ) / 2+$(window).scrollTop() + "px");
  6.         this.css("left", ( $(window).width() - this.width() ) / 2+$(window).scrollLeft() + "px");
  7.         return this;
  8.     }
  9. //javascript/8228

Reply to "Dynamically control the center display of web page elements through jQuery custom jQuery plug-in"

Here you can reply to the paste above

captcha

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