gpt4 book ai didi

javascript - Uncaught ReferenceError : maxHeight is not defined

转载 作者:太空宇宙 更新时间:2023-11-03 20:04:50 26 4
gpt4 key购买 nike

jQuery

$(function maxHeight() {
var maxH = 0;
var contentH = 'calc(100vh - 79px)';
$(".left, .middle, .right").each(function() {
if ($(this).height() <= contentH) {
$(".left, .right").css('justify-content', 'space-between');
$(".middle").css('height', '100%');
} else {
if ($(".middle").height() > $(".left, .right").height()) {
$(".left, .right").css({
'height':'calc(' + contentH + ' - 100px)',
'justify-content':'space-between'
});
$(".middle").css('height',contentH);
} else {
maxH = $(".left, .right").height();
$(".left, .middle, .right").height(maxH);
}
}
});
});
mySwiper.height = maxHeight();

错误提示:Uncaught ReferenceError: maxHeight is not defined
我的代码有什么问题?

edit:我把原来写的问题分在这里了。 -> Code to match the height of the 3 elements in JS, is this correct? - StackOverflow

最佳答案

删除函数周围的 $() 。

关于javascript - Uncaught ReferenceError : maxHeight is not defined,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55703345/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com