自己编写jquery插件

http://blog.csdn.net/chenxi1025/article/details/52222327

https://www.cnblogs.com/ajianbeyourself/p/5815689.html

jQuery.fn.center = function () {
     this.css("top", ( $("body").height() - this.outerHeight() ) / 2+$(window).scrollTop() + "px");
     return this;
}

$(".hint").center();

http://jsbin.com/fagugisiqi/edit?html,js,output

posted @ 2018-01-26 16:02  Amy-WebFrontEnd  阅读(121)  评论(0编辑  收藏  举报