答案 0 :(得分:1)
Ok, so the answer from "user123" was mostly correct but, in terms of browser compatibility it was giving me problems due to $(window).innerHeight();
Which, according to the w3schools description is "the inner height of a window's content area"
However, this was only working on Edge and IE11. To get it working on Edge, IE11, Firefox and Chrome I had to use $(window).outerHeight();
.
Which is described at w3schools as being "the outer height of a window, including toolbars/scrollbars"
Bottom-line: In terms of "sense", it makes none of it but I got it working using the outerHeight() instead of the innerHeight() function.
PS:Posted as an answer to call attention.
答案 1 :(得分:0)
将窗口高度指定为聊天框高度。添加您自己的代码ID或类名,而不是“#myDiv”。
$(document).ready(function() {
function setHeight() {
windowHeight = $(window).outerHeight();
$('#myDiv').css('min-height', windowHeight);
};
setHeight();
$(window).resize(function() {
setHeight();
});
});
有关详情,请参阅此链接:ViewPort