2016-08-31 2 views
1

코드를 제거하려면 가로 스크롤과 세로 스크롤 만 제거하고 싶습니다. 여기에 코드가 있습니다. 컨테이너 div에 대한ScrollPane2에 특정 스크롤 막대를 두는 방법

$('#container').jScrollPane({})
#container{ 
 
     width: 780px; 
 
     height: 140px; 
 
     border: 8px solid #FFF; 
 
     overflow-y: hidden; 
 
    } 
 
    .slider{ 
 
     width: 1400px; 
 
     height: 400px; 
 
     padding: 20px; 
 
     background: #CCCCCC; 
 
    } 
 
    .section{ 
 
     margin:0; 
 
     width:220px; 
 
     float:left; 
 
     margin-right:50px; 
 
    } 
 
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> 
 
<div id="container"> 
 
      <div class="slider"> 
 
       <div class="section">section 1 content</div> 
 
       <div class="section">section 2 content</div> 
 
       <div class="section">section 3 content</div> 
 
       <div class="section">section 4 content</div> 
 
       <div class="section">section 5 content</div> 
 
      </div> 
 
    </div>

+0

를? – beerwin

+0

질문을 수정하면 스 니펫에 오류가 있습니다! – vivekkupadhyay

+0

그것은 JScrollPane에 대한 참조를 가지고 있습니다. – beerwin

답변

0

사용 overflow-y:hiddenoverflow-x:scroll

CSS는

#container{ 
overflow-x:scroll; 
overflow-hidden; 
} 
+0

그것의 작동하지 않습니다 ... –

+0

나타날 수있는 가로 스크롤하려면 ** 컨테이너 **에 약간의 너비를 주어야합니다. –

+0

jsfiddle에서 예제를 보내주십시오. –

0

대신 스크롤의 '자동차'의 사용을 선호합니다. 콘텐츠가 블록 스크롤바에 맞을 경우에는 표시되지 않습니다.

#container{ 
    width: 780px; 
    height: 140px; 
    border: 8px solid #FFF; 
    overflow-y: hidden; 
    overflow-x: auto; 
} 
+0

그게 작동하지 않습니다 ... –

0

JScrollPane의 웹 사이트 (http://jscrollpane.kelvinluck.com/arrows.html)의 예에 따르면, 단지 컨테이너 사업부에이 스타일을 추가 JScrollPane의가 무엇

.horizontal-only 
{ 
    height: auto; 
    max-height: 200px; 
} 
+0

그게 작동하지 않습니다 ... –

관련 문제