iphone/ipad triggering unexpected resize events

前端 未结 8 2058
北荒
北荒 2020-12-13 01:54

I\'m working on a mobile version of my site. I\'m using media queries and CSS as much as possible, but I\'m also using some javascript to, for example, turn my navigation in

相关标签:
8条回答
  • 2020-12-13 02:16

    Is the assumption wrong, that you only want to have the effect of the resize event on a non-touch device? If so you could just use Modernizr and do a check like:

        $(window).resize(function(e){
           if(Modernizr.touch) {
             e.preventDefault();
           }
        });
    
    0 讨论(0)
  • 2020-12-13 02:23

    Check if your explicitly scrolling the html body wrapper to hide the address bar when the page loads.

    0 讨论(0)
提交回复
热议问题