我創建了一個框,我想在左右方向上水平滾動內容,並且想要使用觸摸進行滑動並隱藏滾動條,這裏是工作區JSfiddle隱藏滾動條並用CSS左右滑動
我應該嘗試使用任何JSplugin來處理這個問題,還是這件事很容易實現?請建議
.spotlight_graphs {
bottom: 30px;
clear: both;
left: 0;
margin-left: auto;
margin-right: auto;
max-width: 360px;
overflow: auto;
position: absolute;
right: 0;
width: 100%;
background-color:#cbcbcb;
overflow:auto;
padding:10px;
}
.spotlight_graphs > ul {
font-size: 0;
list-style: outside none none;
margin: 0;
padding: 0;
text-align:left;
width:200%;
}
.spotlight_graphs > ul > li {
max-width: 90px;
width: 33%;
display:inline-block;
background-color:#dec8c8;
height:100px;
margin:0 5px 5px 0;
border:1px solid #333333;
}
.spotlight_graphs > ul > li > .graph_detail {
color: #404040;
float: left;
font-size: 14px;
text-align: center;
text-transform: uppercase;
width: 100%;
}
<div class="spotlight_graphs">
<ul>
<li>
<div class="graph_detail"> This is dummy title </div>
</li>
<li>
<div class="graph_detail"> This is dummy title </div>
</li>
<li>
<div class="graph_detail"> This is dummy title </div>
</li>
<li>
<div class="graph_detail"> This is dummy title </div>
</li>
<li>
<div class="graph_detail"> This is dummy title </div>
</li>
</ul>
</div>
在移動瀏覽器做,滾動條將不會顯示在桌面瀏覽器。當您滑動時會出現一條細小的線條,插入其容器中,並且不會影響佈局的任何內容。如果你願意,你可以使用任何其他的jquery插件,例如http://nicescroll.areaaperta.com/demo.html。 – Ravimallya