Jquery 是否检测相对于窗口的div high?
这是我的jQuery代码,我想给出divtopImgs相对于窗口高度的高度,它是如何工作的Jquery 是否检测相对于窗口的div high?,jquery,Jquery,这是我的jQuery代码,我想给出divtopImgs相对于窗口高度的高度,它是如何工作的 $("#topImgs").css("height", function(){ $( window ).height(); }); 看起来您需要返回窗口的高度: 不过,实际上您可能不需要jQuery。在中,您可以使用: 你是说更像$topImgs.csheigh、$window.height的东西?太好了,非常感谢: $("#topImgs").css("height", functio
$("#topImgs").css("height", function(){
$( window ).height();
});
看起来您需要返回窗口的高度: 不过,实际上您可能不需要jQuery。在中,您可以使用:
你是说更像$topImgs.csheigh、$window.height的东西?太好了,非常感谢:
$("#topImgs").css("height", function () {
return $(window).height(); /* Some calculation here.. */
});
$("#topImgs").css("height", $(window).height());
#topImgs {
height: 100vh;
}