當前位置:編程學習大全網 - 網站源碼 - Js和jquery如何隱藏瀏覽器地址欄(網頁優化,手機可以,ipad mini不可以,求大神指點)

Js和jquery如何隱藏瀏覽器地址欄(網頁優化,手機可以,ipad mini不可以,求大神指點)

window.addEventListener("load ",function()?{

setTimeout(function(){

window.scrollTo(0,1);

},?0);

});

這僅在您的瀏覽器內容高於您的瀏覽器時有用。

if(document . document element . scroll height?& lt=?document . document element . client height)?{

bodyTag?=?document . getelementsbytagname(' body ')[0];

bodyTag.style.height?=?document . documentelement . client width?/?屏幕寬度?*?屏幕.高度?+?px’;

}?

這是內容沒有瀏覽器高的時候。

總而言之:

& lt腳本& gt

window.onload=function(){

if(document . document element . scroll height?& lt=?document . document element . client height)?{

bodyTag?=?document . getelementsbytagname(' body ')[0];

bodyTag.style.height?=?document . documentelement . client width?/?屏幕寬度?*?屏幕.高度?+?px’;

}

setTimeout(函數()?{

window.scrollTo(0,1)

},?0);

};

& lt/script & gt;試試看。

  • 上一篇:html5播放器如何
  • 下一篇:linux鏡像文件在哪裏?
  • copyright 2024編程學習大全網