2016-08-16 5 views
4

활성화 방법 Javascript를 사용하는 휴대 기기에서 Chrome의 주소 표시 줄에 항상이 표시 되나요?
즉, 사용자 으로 스크롤 될 때 숨기지 마십시오.자바 스크립트 : 항상 Chrome 주소 표시 줄 표시

+1

당신은 할 수 가짜 스크롤하지만 까다로운. – gcampbell

+0

div로 HTML을 래핑 할 수 있습니다. 높이를 100 %로 설정합니다. – 4dgaurav

+0

@thesaurabhway 어떻게 작동합니까? 내가 본 것처럼 스크롤 페이지와 숨어있는 주소 표시 줄이 표시됩니다. – Alexander

답변

1

div을 만들고 높이를 100%으로 설정하고 overflow-y:auto;을 사용할 수 있습니다.

이 코드를 복사하여 프로젝트에 붙여 넣으면 원하는 코드가 표시됩니다.

조심해서 사용하십시오. 개인적으로 크롬이 탐색 바를 숨 깁니다. 또한 미래에, 당신이 정말로 당신의 질문에 대답하지 않는 대답을 받아들이면, 아무도 그것을 풀 수 없다는 것을 명심하십시오.

예 :

/* You NEED to set the container height */ 
 
html, body { 
 
    height:100%; 
 
} 
 

 
/* Then override the scrollbar by a custom scrollable element: */ 
 
.customnavigation { 
 
    height:100%; 
 
    overflow-y:auto; 
 
}
<div class="customnavigation"> 
 
    <img src="http://placehold.it/150x150"> 
 
    <img src="http://placehold.it/150x150"> 
 
    <img src="http://placehold.it/150x150"> 
 
    <img src="http://placehold.it/150x150"> 
 
    <img src="http://placehold.it/150x150"> 
 
    <img src="http://placehold.it/150x150"> 
 
    <img src="http://placehold.it/150x150"> 
 
    <img src="http://placehold.it/150x150"> 
 
    <img src="http://placehold.it/150x150"> 
 
    <img src="http://placehold.it/150x150"> 
 
    <img src="http://placehold.it/150x150"> 
 
    <img src="http://placehold.it/150x150"> 
 
    <img src="http://placehold.it/150x150"> 
 
    <img src="http://placehold.it/150x150"> 
 
    <img src="http://placehold.it/150x150"> 
 
    <img src="http://placehold.it/150x150"> 
 
    <img src="http://placehold.it/150x150"> 
 
    <img src="http://placehold.it/150x150"> 
 
    <img src="http://placehold.it/150x150"> 
 
    <img src="http://placehold.it/150x150"> 
 
    <img src="http://placehold.it/150x150"> 
 
    <img src="http://placehold.it/150x150"> 
 
    <img src="http://placehold.it/150x150"> 
 
    <img src="http://placehold.it/150x150"> 
 
    <img src="http://placehold.it/150x150"> 
 
    <img src="http://placehold.it/150x150"> 
 
    <img src="http://placehold.it/150x150"> 
 
    <img src="http://placehold.it/150x150"> 
 
</div>

+0

실제로 그렇지 않습니다. 이 이론을 설명해 주시겠습니까? – Alexander

+1

@Alexander 이전에이 방법을 사용 했었지만, margin-top과 height (calc (100 % - margin-top))를 약간 조정해야 할 수도 있습니다. 이론은 스크롤 가능한 내용을 가진 상자를 생성하지만 상자 자체는 페이지 자체만큼 높다는 것입니다. 따라서 '본문'은 스크롤되지 않으며 헤더가 축소되도록 트리거하지 않습니다. – Randy

+0

@Alexander이 유용한 정보를 찾을 수 있습니다. http://stackoverflow.com/questions/25298443/force-address-bar-to-show-in-mobile-chrome-app – Randy