Jquery 100%高度可调整大小和移动

Jquery 100%高度可调整大小和移动,jquery,mobile,Jquery,Mobile,不工作了,如果我调整我的窗口,但在移动它的工作 <script> var clientHeight = $( window ).height(); $('.container-bigpic').css('height', clientHeight); </script> 它不再适用于手机,但如果我调整浏览器窗口的大小,它将适合100vh。您忘记了像素--$('container bigpic').css('height',clientHeight+“px”);你是说像这

不工作了,如果我调整我的窗口,但在移动它的工作

<script>
var clientHeight = $( window ).height();
$('.container-bigpic').css('height', clientHeight);
</script>

它不再适用于手机,但如果我调整浏览器窗口的大小,它将适合100vh。

您忘记了像素--$('container bigpic').css('height',clientHeight+“px”);你是说像这样?问题是,它在移动屏幕上不起作用:var clientHeight=$(window.height()$('.container bigpic').css('height',clientHeight+“px”);})。在(“resize”,function(){//如果用户调整窗口的大小winH=$(this).height();//您将需要新的高度值});要重新调整窗口大小,请使用javascript调整大小函数(window.onresize=function(event){--code--};),这是否必须使用JQuery?为什么不使用CSS媒体查询?我之所以提到这一点,是因为:打开(“调整大小”)会为窗口移动的每个像素触发,这将增加大量资源使用
}).on("resize", function(){ // If the user resizes the window
   winH = $(this).height(); // you'll need the new height value
});