mobile chrome fires resize event on scroll

前端 未结 7 1227
独厮守ぢ
独厮守ぢ 2020-11-30 23:20

I\'m using the chrome mobile browser on galaxy s4, android 4.2.2 and for some reason every time I scroll the page down, it fires a resize event verified by the scaling of im

7条回答
  •  执念已碎
    2020-11-30 23:59

    I don't know is it still interesting, but My solution is : )

    var document_width, document_height;
    
    $(document).ready(function()
    {
    	document_width=$(document).width(); document_height=$(document).height();
        // Do something
    }
    
    $(window).resize(function()
    {
        if(document_width!=$(document).width() || document_height!=$(document).height()) 
        {
            document_width=$(document).width(); document_height=$(document).height();
            // Do something
        }
    }	

提交回复
热议问题