세로 스크롤 막대가 내용을 밀어 내지 않게하는 방법이 있습니까?스크롤바 오프셋을 조정 하시겠습니까?
나는 입력이 토글 될 때마다 (콘텐츠가 중앙에 위치 함) 다른 입력에 따라 높이가 변하는 페이지가 있고 스크롤바는 내 콘텐츠를 앞뒤로 밀고 있습니다.
필자는 CSS와 약간의 jquery로 조정 해 보았지만 효과가없는 것 같습니다. 스크롤바를 숨기거나 스크롤바를 항상 보이게하고 싶지 않습니다.
자바 스크립트 또는 jquery를 사용하여 조정할 수 있습니다. 을 heres jsFiddle과를 heres 내 코드 :
<center>
<div id="content-container">
<div id="img" style="left: 50%; position:fixed">
<img src="http://www.google.com/images/logos/ps_logo2.png" width="122">
</div>
<div id="panel" style="position:absolute;top:1950px; border:solid; widt:00px; ">
<div class="content">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
</div><!-- Panel -->
</div><!-- content -->
</div><!-- content-container -->
</center>
<script>
// On load panel slides in from bottom of page
$("#panel").delay(100).animate({
top: "150px"
}, 1000);
</script>
나는 솔루션 Javascript scroll offset을 사용했지만 확실하지 오전 어쩌면 생각했다.
질문이 명확하지 않습니다. 스크롤바가있는 경우에도 콘텐츠가 항상 처음부터 표시되기를 원하십니까? – Hussein