我正在尝试检测移动设备上的方向变化并在完成方向后触发一个函数,但该函数中的代码在Android中不断触发,我不确定为什么。这是我的代码:varsupportsOrientationChange="onorientationchange"inwindow;varorientationEvent=supportsOrientationChange?"orientationchange":"resize";window.addEventListener(orientationEvent,function(){alert('orientationchanged');},false);有谁知道如