landscape && landscape (ok)
function doOnOrientationChange() {
    switch(window.orientation) {  
      case -90: case 90:
        alert('landscape');
        break; 
      default:
        alert('landscape');
        break; 
    }
}
  
window.addEventListener('orientationchange', doOnOrientationChange);
  
// Initial execution if needed
doOnOrientationChange();https://stackoverflow.com/questions/5284878/how-do-i-correctly-detect-orientation-change-using-phonegap-on-iosPreviousClick lần đầu sử event.preventDefault(); lầu sau not event.preventDefault();NextLandscape && Portrait (ok) job247.vn
Last updated