标签:bin play flex rect 滚动效果 菜单 ali -o 滚动
不运用<ion-scroll>,直接用css样式,做成菜单栏的横向滚动。
最外层div设置display:-webkit-box;overflow-x:scroll
<div class="bar has-header" style="height: 44px;color: #000000;padding:0">
<div class="menu-box">
<div ng-repeat="x in titleList">
<div class="menu-item" ng-bind="x" ng-click="changeRecord($index)" ng-class="isActive == $index?‘activeBot‘:‘‘">
</div>
</div>
</div>
</div>
.menu-box{
margin:0 10px;
display: -webkit-box; // flex-direction:row
overflow-x: scroll;
-webkit-overflow-scrolling: touch; //模拟移动端滚动效果
}
.menu-item{
width: auto;
line-height: 44px;
text-align: center;
padding-left: 5px;
padding-right: 5px;
}
::-webkit-scrollbar {display:none} //隐藏滚动条
标签:bin play flex rect 滚动效果 菜单 ali -o 滚动
原文地址:https://www.cnblogs.com/Amanda-w/p/11647899.html