server/aspnetapp/wwwroot/lib/jquery.matchHeight.js

(开头部分) 12KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

/**
* jquery-match-height master by @liabru
* http://brm.io/jquery-match-height/
* License: MIT
*/

; ( function ( factory ) { // eslint-disable-line no-extra-semi
    'use strict';
    if ( typeof define === 'function' && define.amd ) {
        // AMD
        define( ['jquery'], factory );
    } else if ( typeof module !== 'undefined' && module.exports ) {
        // CommonJS
        module.exports = factory( require( 'jquery' ) );
    } else {
        // Global
        factory( jQuery );
    }
} )( function ( $ ) {
    /*
    *  internal
    */

    var _previousResizeWidth = -1,
        _updateTimeout = -1;

    /*
    *  _parse
    *  value parse utility function
    */

    var _parse = function ( value ) {
        // parse value and convert NaN to 0
        return parseFloat( value ) || 0;
    };

    /*
    *  _rows
    *  utility function returns array of jQuery selections representing each row
    *  (as displayed after float wrapping applied by browser)
    */

    var _rows = function ( elements ) {
        var tolerance = 1,
            $elements = $( elements ),
            lastTop = null,
            rows = [];

        // group elements by their top position
        $elements.each( function () {
            var $that = $( this ),
                top = $that.offset().top - _parse( $that.css( 'margin-top' ) ),
                lastRow = rows.length > 0 ? rows[rows.length - 1] : null;

            if ( lastRow === null ) {
                // first item on the row, so just push it
                rows.push( $that );
            } else {
                // if the row top is the same, add to the row group
                if ( Math.floor( Math.abs( lastTop - top ) ) <= tolerance ) {
后面还有 328 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。