Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/431.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/74.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 具有展开预览的栅格-基于内容高度计算高度_Javascript_Jquery_Css_Html - Fatal编程技术网

Javascript 具有展开预览的栅格-基于内容高度计算高度

Javascript 具有展开预览的栅格-基于内容高度计算高度,javascript,jquery,css,html,Javascript,Jquery,Css,Html,我使用的是“”教程中的功能(和其他人一样,它看起来是O_O),我的所有功能都按照我想要的方式工作,除了div.og-expanded扩展到页面的整个高度之外,我希望div.og-expanded只扩展到容器中内容的大小 我正在使用来自的最新代码 div.og-expanded的高度似乎由grid.js中的calcHeight:函数控制 calcHeight : function() { var heightPreview = winsize.height - t

我使用的是“”教程中的功能(和其他人一样,它看起来是O_O),我的所有功能都按照我想要的方式工作,除了div.og-expanded扩展到页面的整个高度之外,我希望div.og-expanded只扩展到容器中内容的大小

我正在使用来自的最新代码

div.og-expanded的高度似乎由grid.js中的calcHeight:函数控制

        calcHeight : function() {

        var heightPreview = winsize.height - this.$item.data( 'height' ) - marginExpanded,
            itemHeight = winsize.height;

        if( heightPreview < settings.minHeight ) {
            heightPreview = settings.minHeight;
            itemHeight = settings.minHeight + this.$item.data( 'height' ) + marginExpanded;
        }

        this.height = heightPreview;
        this.itemHeight = itemHeight;

    },
    setHeights : function() {

        var self = this,
            onEndFn = function() {
                if( support ) {
                    self.$item.off( transEndEventName );
                }
                self.$item.addClass( 'og-expanded' );
            };

        this.calcHeight();
        this.$previewEl.css( 'height', this.height );
        this.$item.css( 'height', this.itemHeight ).on( transEndEventName, onEndFn );

        if( !support ) {
            onEndFn.call();
        }

    },
calcHeight:function(){
var heightPreview=winsize.height-this.$item.data('height')-marginanded,
itemHeight=winsize.height;
如果(高度预览
正如我所说的,我不想使用窗口大小来获得高度,而是希望以div.og-expander-inner的内容高度为基础。我看到了一个类似的问题“该解决方案根据div.og-fullimg或div.og-details的内容(本质上是什么)计算高度,以较高者为准。这是一个不错的解决方案,因为它考虑了内容的响应性,这对我很重要。不幸的是,我无法确定如何将此解决方案应用于原始源代码

这里的任何帮助都将不胜感激