我们知道mobile设备上监测转屏的事件是orientationchange,但这个事件支持得不太好,有些android就不支持orientation事件
zepto.js中扩展了一个 $.support 来检测是否支持orientation
(function($) { /** * @name $.support * - ***orientation*** 检测是否支持转屏事件,UC中存在orientaion,但转屏不会触发该事件,故UC属于不支持转屏事件(iOS 4上qq, chrome都有这个现象) */ $.support = $.extend($.support || {}, { orientation: !(br.uc || (parseFloat($.os.version) < 5 && (br.qq || br.chrome))) && !($.os.android && parseFloat($.os.version) > 3) && "orientation" in window && "onorientationchange" in window }); })(Zepto);