/* 插件:等高jquery-match-height 版本:0.7.0 官网:http://brm.io/jquery-match-height/ $(".example").matchheight({ byrow: true, // 按行匹配高度 property: "height", // 匹配的属性 target: null, // 匹配的目标元素 remove: false // 是否移除匹配高度 }); */ !function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"undefined"!=typeof module&&module.exports?module.exports=t(require("jquery")):t(jquery)}(function(t){var e=-1,o=-1,n=function(t){return parsefloat(t)||0},a=function(e){var o=1,a=t(e),i=null,r=[];return a.each(function(){var e=t(this),a=e.offset().top-n(e.css("margin-top")),s=r.length>0?r[r.length-1]:null;null===s?r.push(e):math.floor(math.abs(i-a))<=o?r[r.length-1]=s.add(e):r.push(e),i=a}),r},i=function(e){var o={byrow:!0,property:"height",target:null,remove:!1};return"object"==typeof e?t.extend(o,e):("boolean"==typeof e?o.byrow=e:"remove"===e&&(o.remove=!0),o)},r=t.fn.matchheight=function(e){var o=i(e);if(o.remove){var n=this;return this.css(o.property,""),t.each(r._groups,function(t,e){e.elements=e.elements.not(n)}),this}return this.length<=1&&!o.target?this:(r._groups.push({elements:this,options:o}),r._apply(this,o),this)};r.version="0.7.2",r._groups=[],r._throttle=80,r._maintainscroll=!1,r._beforeupdate=null,r._afterupdate=null,r._rows=a,r._parse=n,r._parseoptions=i,r._apply=function(e,o){var s=i(o),h=t(e),l=[h],c=t(window).scrolltop(),p=t("html").outerheight(!0),u=h.parents().filter(":hidden");return u.each(function(){var e=t(this);e.data("style-cache",e.attr("style"))}),u.css("display","block"),s.byrow&&!s.target&&(h.each(function(){var e=t(this),o=e.css("display");"inline-block"!==o&&"flex"!==o&&"inline-flex"!==o&&(o="block"),e.data("style-cache",e.attr("style")),e.css({display:o,"padding-top":"0","padding-bottom":"0","margin-top":"0","margin-bottom":"0","border-top-width":"0","border-bottom-width":"0",height:"100px",overflow:"hidden"})}),l=a(h),h.each(function(){var e=t(this);e.attr("style",e.data("style-cache")||"")})),t.each(l,function(e,o){var a=t(o),i=0;if(s.target){i=s.target.outerheight(!1)}else{if(s.byrow&&a.length<=1){return void a.css(s.property,"")}a.each(function(){var e=t(this),o=e.attr("style"),n=e.css("display");"inline-block"!==n&&"flex"!==n&&"inline-flex"!==n&&(n="block");var a={display:n};a[s.property]="",e.css(a),e.outerheight(!1)>i&&(i=e.outerheight(!1)),o?e.attr("style",o):e.css("display","")})}a.each(function(){var e=t(this),o=0;s.target&&e.is(s.target)||("border-box"!==e.css("box-sizing")&&(o+=n(e.css("border-top-width"))+n(e.css("border-bottom-width")),o+=n(e.css("padding-top"))+n(e.css("padding-bottom"))),e.css(s.property,i-o+"px"))})}),u.each(function(){var e=t(this);e.attr("style",e.data("style-cache")||null)}),r._maintainscroll&&t(window).scrolltop(c/p*t("html").outerheight(!0)),this},r._applydataapi=function(){var e={};t("[data-match-height], [data-mh]").each(function(){var o=t(this),n=o.attr("data-mh")||o.attr("data-match-height");n in e?e[n]=e[n].add(o):e[n]=o}),t.each(e,function(){this.matchheight(!0)})};var s=function(e){r._beforeupdate&&r._beforeupdate(e,r._groups),t.each(r._groups,function(){r._apply(this.elements,this.options)}),r._afterupdate&&r._afterupdate(e,r._groups)};r._update=function(n,a){if(a&&"resize"===a.type){var i=t(window).width();if(i===e){return}e=i}n?o===-1&&(o=settimeout(function(){s(a),o=-1},r._throttle)):s(a)},t(r._applydataapi);var h=t.fn.on?"on":"bind";t(window)[h]("load",function(t){r._update(!1,t)}),t(window)[h]("resize orientationchange",function(t){r._update(!0,t)})});