$(window).resize(); doesn't work

后端 未结 5 2049
梦谈多话
梦谈多话 2021-01-28 07:21

I\'ve got a problem with window.resize . My code js/jquery is here

var x = $(window).width();
var y = $(window).height();
var z = $(\'#card\').height();
var a =          


        
5条回答
  •  长发绾君心
    2021-01-28 08:00

    I think you have to use this, because the way you are doing it, the function is executed and the return value of the function is set as the callback function, which will not work:

    $(document).ready(function() {
        updateBodySize();
    }); //kiedy zaladowany
    $(window).resize(function() {
        updateBodySize();
    });  //kiedy zmiana rozmiaru
    

提交回复
热议问题