Will $(window).resize() fire on orientation change?
问题 Im using this to run some code when a browser window is resized: $(window).resize(callback) I also need to run this code when the orientation is changed in phones and tablets. Will the above fire on this event? 回答1: Some devices/browsers do, some not. You need to decide your supported browsers and devices. If you want to be on secure side you should use the resize event and get/check the sizes inside in it; if you know your desired devices go with a simple orientation change: Easy solution: /