js 判斷手機是否全面屏

function judgeBigScreen() {  //,這裏根據返回值 true 或false ,返回true的話 則爲全面屏 
  let result = false;
  const rate = window.screen.height / window.screen.width;    
  let limit =  window.screen.height == window.screen.availHeight ? 1.8 : 1.65; // 臨界判斷值  
       
    // window.screen.height爲屏幕高度
   //  window.screen.availHeight 爲瀏覽器 可用高度
   
  if (rate > limit) {
  result = true;
  }
  return result;
};
相關文章
相關標籤/搜索